Event Loop

Microtask Queue

A higher-priority queue for promise callbacks and queueMicrotask. It's drained completely — every microtask runs — before the next macrotask or a render.

Two .then() callbacks both run before the next setTimeout gets a turn.

Microtask Q
.then #1
.then #2
Call Stack
Drained fully before the next task

Tap the example to replay it · press and hold to slow it down

One of 40 cards in javascript flashcards. Browse every card.