Grasp Event Loop — JavaScript event loop visualizer
Grasp Event Loop shows the order in which JavaScript runs code. One screen holds the editor, the console, and the
diagram: Call Stack, Web API, Event Loop, macrotask queue, and microtask queue.
This is how you work through the interview question “what does this code log”: by watching a task move through
the stack and the queues. Synchronous code runs immediately. setTimeout and setInterval wait in the Web API.
then, catch, finally, queueMicrotask, and the continuation after await become microtasks and run before any
macrotask.
The list has 68 examples, from the basics to an interview: nested calls, a 0 ms delay, Promise, async/await,
try/catch, let and var in a loop, Promise.all, Promise.race, Promise.allSettled, debounce, and throttle. Your
own code can use the same step-by-step run.
Turn on JavaScript to use the visualizer.