All 13

Glossary

The runtime vocabulary, one page. Each term comes with the distinction that actually matters and a case where you can watch it in action.

Event loop

The host mechanism that repeatedly picks one task, runs it to completion, drains the microtask queue, and (in browsers) may then update the rendering. It is scheduling logic in the host, not a feature of the JavaScript language itself.

Easily confused: Not a thread and not a queue — it is the loop that services the queues. JavaScript stays single-threaded; concurrency lives in the host around it.

How the Event Loop Runs → · How It All Runs Together →

Call stack

The single stack of frames tracking which function is currently executing. Synchronous code runs until this stack is empty; only then can the event loop deliver anything from a queue.

Easily confused: A stack (LIFO), not a queue: the newest frame is always the one running. "Stack empty" is the precondition for every queued callback.

How the Event Loop Runs →

Task ("macrotask")

One unit of work the event loop runs per iteration: executing a script, a timer callback, an event handler. The HTML spec calls these tasks; "macrotask" is community shorthand that appears in no specification.

Easily confused: One task per loop iteration — unlike microtasks, which drain completely. Browsers keep several task queues (timers, user interaction, networking) and may choose between them.

How Timers Really Run → · How Promises Run →

Microtask

A callback in the microtask queue: promise reactions, await continuations, queueMicrotask, MutationObserver. Drained completely at the checkpoint after the current task — including microtasks queued during the drain.

Easily confused: Beats every waiting task, but cannot interrupt running code. An endless microtask chain starves tasks and rendering alike.

How Promises Run → · How Promise Chains Run →

Microtask checkpoint

The moment the microtask queue is drained: whenever the call stack empties after running a task or callback. This is also when the host decides which rejected promises count as unhandled.

Easily confused: A point in time, not a place. "When the stack empties" is the answer to most "when does my .then run?" questions.

How Rejections Run →

await continuation

The rest of an async function after an await, packaged up when the function suspends. It queues as an ordinary microtask once the awaited promise settles — FIFO with everything else in that queue.

Easily confused: While the promise is pending, the continuation is parked on it — NOT waiting in any queue. Suspended and queued are different states.

How await Runs → · How fetch Runs →

Unhandled rejection

A promise that is rejected and still has no rejection handler when the host checks after the microtask checkpoint. Browsers fire the unhandledrejection event; modern Node exits the process by default.

Easily confused: Decided by the host at the checkpoint, not at the throw. Attaching a .catch in the same turn keeps a rejection out of unhandled territory entirely.

How Rejections Run →

process.nextTick (Node)

A Node-only queue drained before promise microtasks, between every phase of its event loop. Node documents it as legacy and recommends queueMicrotask for ordinary deferral.

Easily confused: Not a microtask — a separate, higher-priority queue. And the "before promises" ordering is a CommonJS observation: top-level ESM code already runs inside a microtask, which flips it.

How Node Runs It →

Module job (ESM evaluation)

ES modules are evaluated as jobs — meaning top-level .mjs code runs inside a microtask context, unlike a classic script or CommonJS module body, which run as a plain task.

Easily confused: The reason the same Node file can print a different order as .cjs and .mjs. The invocation context is part of the semantics.

How Node Runs It →

Rendering step

The browser phase that may follow the microtask checkpoint: run requestAnimationFrame callbacks, recompute style, run layout, paint. "May" — the browser renders when a frame is due, not every loop iteration.

Easily confused: Not a queue the loop polls; a phase it may enter. Everything JavaScript does sits between paints, which is why a long task or microtask chain drops frames.

How Rendering Fits In →

"Web APIs"

The teaching label for host machinery outside JavaScript: timer threads, the network stack, I/O. Work handed to it proceeds off the main thread; finished callbacks come back through the queues.

Easily confused: A diagram label, not a spec term. The point it makes is real, though: the waiting happens outside JavaScript, which is why the thread stays free.

How Timers Really Run → · How fetch Runs →

Sources: HTML Standard — Event loops · ECMAScript — Jobs · MDN — Microtask guide . Last reviewed 29 July 2026.