Last active
March 31, 2023 08:59
-
-
Save naazeri/e55b0011eeb20fa46e540ccf01d25d37 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
setTimeout(() => { | |
console.log("timeout 1") | |
Promise.resolve().then(() => { | |
console.log("p1") | |
}) | |
}, 0) | |
setTimeout(() => { | |
console.log("timeout 2") | |
}, 0) | |
setTimeout(() => { | |
console.log("timeout 3") | |
Promise.resolve().then(() => { | |
console.log("p2") | |
}) | |
process.nextTick(() => { | |
console.log("t1") | |
}) | |
}, 0) | |
process.nextTick(() => { | |
console.log("t2") | |
}) | |
process.nextTick(() => { | |
console.log("t3") | |
}) | |
Promise.resolve().then(() => { | |
console.log("p3") | |
Promise.resolve().then(() => { | |
console.log("p4") | |
}) | |
}) | |
Promise.resolve().then(() => { | |
console.log("p5") | |
process.nextTick(() => { | |
console.log("t4") | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment