Junior
From PDF
JavaScript
JavaScript
What is the difference between microtask and macrotask queue?
Type Example Priority
Microtask Promise.then,
MutationObserver
Higher
Macrotask setTimeout, setInterval Lower
Example:
setTimeout(() => console.log("Macro"), 0);
Promise.resolve().then(() => console.log("Micro"));
// Output: Micro → Macro
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png