Created
August 2, 2019 16:13
-
-
Save json2d/a44ec93e9484eb4f38f89546b0c9f642 to your computer and use it in GitHub Desktop.
promise execution order
This file contains 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
let prom = new Promise(res => { | |
console.log('A') | |
setTimeout(res,1000) | |
}) | |
prom.then(res => { | |
console.log('B') | |
}) | |
console.log('C') | |
// A | |
// C | |
// B |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment