Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dfkaye
Created January 14, 2023 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dfkaye/0e6c6f41d7daa89c07016f842dc0a573 to your computer and use it in GitHub Desktop.
Save dfkaye/0e6c6f41d7daa89c07016f842dc0a573 to your computer and use it in GitHub Desktop.
what is the order of processing when using queueMicrotask?
// 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