Created
April 29, 2020 04:57
-
-
Save bitfishxyz/d1ef36c21606320edbd42f2b9d5db447 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const promise1 = new Promise((resolve, reject) => { | |
const timer1 = setTimeout(() => { | |
resolve('success') | |
}, 1000) | |
}) | |
const promise2 = promise1.then(() => { | |
throw new Error('error!!!') | |
}) | |
console.log('promise1', promise1) | |
console.log('promise2', promise2) | |
const timer2 = setTimeout(() => { | |
console.log('promise1', promise1); | |
console.log('promise2', promise2); | |
}, 2000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment