[KongchangAI]
ConceptMicrotask Queue

Microtask Queue

A task queue in the JavaScript runtime that holds microtasks such as Promise callbacks and those scheduled via queueMicrotask, and is fully drained and executed after the current macrotask completes.

Timeline (last 90 days)

Nov 17

The JavaScript runtime maintains a microtask queue, into which every Promise's .then, .catch, and .finally callbacks as well as queueMicrotask calls are enqueued.

Unverified50%
Nov 17

The microtask queue is fully drained after the current macrotask ends and before the next macrotask begins, so multiple consecutive .then calls complete synchronously within the same event loop turn.

Unverified50%

All Facts (2)

Source Articles