JavaScript is single-threaded, non-blocking, and asynchronous. Step through how the V8 engine JIT compiler, Call Stack, Web APIs, and Microtask queues work in unison.
Step through Call Stack, Web APIs, Microtask Queue (Promises), and Macrotask Queue (Timers).
Click 'Play' or 'Step Forward' to begin stepping through the JavaScript runtime execution cycle.
How Chrome & Node.js parse JavaScript source code into an Abstract Syntax Tree (AST), Bytecode (Ignition), and Optimized Machine Code (TurboFan).
From human-readable script to bytecode and optimized machine code running within the single-threaded Event Loop.
Raw UTF-8 JavaScript source text received from network or file system.
console.log("Start");
setTimeout(() => console.log("Timeout"), 0);
Promise.resolve().then(() => console.log("Microtask"));Functions in JavaScript retain access to their outer lexical environment even after the parent function has finished executing and returned.
function makeCounter() {
let count = 0;
return () => ++count;
}Syntactic sugar over the Microtask queue. `await` pauses execution of the async function body, releasing the main thread until the Promise settles.
const res = await fetch(url);
const data = await res.json();Generational garbage collection (Scavenger for young generation, Mark-Sweep-Compact for old generation) operating concurrently in background threads.