Web APIs

Microtask checkpoint

Try the free JavaScript compiler

HTML scheduling procedure that drains the microtask queue at appropriate points. Reentrant checkpoints are guarded; unbounded microtask production can delay subsequent work.

Formal Syntax & Structure

javascript syntaxjavascript
queueMicrotask(callback);

Working Example

Example Snippetjavascript
queueMicrotask(() => { console.log("A"); queueMicrotask(() => console.log("C")); });Promise.resolve().then(() => console.log("B"));console.log("S");
JavaScript Reference