Event Loop Visualizer

Step through JavaScript execution. Watch the call stack, Web APIs, microtask queue, and macrotask queue — and see why microtasks always drain before the next task.

Step 0 / 0

Select an example and press Step to begin.

Source

Call Stack LIFO · sync only
Web APIs / Timers host environment
Microtask Queue drain fully each turn
Macrotask Queue one task per loop turn

Console

Loop turn: run one macrotask (or initial script) → drain all microtasks → optionally render → repeat. Microtasks include Promise.then, queueMicrotask, and MutationObserver. setTimeout callbacks land in the macrotask queue after the timer fires in Web APIs.