ES6 / 2015
ES20152015The largest single revision of the language. Block scoping, lexical `this`, class syntax, and a standardised Promise — the foundation of every later feature.
A standard object for a value that is not here yet — and, crucially, a standard scheduling rule: reactions run on the microtask queue, always after the current synchronous run to completion.
console.log("1 sync");
setTimeout(() => console.log("4 macrotask"), 0);
Promise.resolve()
.then(() => console.log("3 microtask"));
console.log("2 sync");| V8 | Owns the microtask queue itself; the host decides when checkpoints run. `queueMicrotask` and promise reactions share one FIFO queue. |
|---|---|
| Node.js | libuv drives phases; microtasks drain after each macrotask AND between each `process.nextTick` batch — nextTick jumps ahead of promises. |
| Deno | Tokio event loop over V8, no nextTick queue in native code — promise ordering matches the browser far more closely. |
| Bun | JavaScriptCore instead of V8; microtask semantics are spec-identical, but timer resolution and task batching differ measurably. |