Created
November 17, 2018 03:33
-
-
Save YSMull/45bf84caeb8721523d4adf28b2449a97 to your computer and use it in GitHub Desktop.
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
async function fn1() { | |
console.log(1); | |
await new Promise((resolve, reject) => { | |
console.log(2); | |
resolve(); | |
}) | |
console.log(3); | |
}; | |
fn1(); | |
console.log(4) | |
console.log(5) |
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
console.log(1) | |
new Promise(function (resolve, reject) { | |
resolve(new Promise((resolve, reject) => { | |
console.log(2); | |
resolve(); | |
})) | |
}).then(() => { | |
console.log(3); | |
}) | |
console.log(4) | |
console.log(5); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment