Created
January 14, 2023 05:29
-
-
Save dfkaye/0e6c6f41d7daa89c07016f842dc0a573 to your computer and use it in GitHub Desktop.
what is the order of processing when using queueMicrotask?
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
// 13 January 2023 | |
// what is the order of processing when using queueMicrotask? | |
// synchronous sequence | |
// microtask | |
// promise resolution | |
queueMicrotask((_) => { | |
console.log(_, "task"); | |
}); | |
Array.from({length: 20}).forEach((v, i) => { | |
Promise.resolve(i).then((o) => console.info(o)); | |
console.warn(i); | |
}); | |
// list of warnings | |
// log task | |
// list of infos |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment