Idea · Aug 8, 2026
JS Event Loop Visualizer
An interactive browser tool where you paste JavaScript code and watch the call stack, Web APIs register, microtask queue, and callback queue animate step by step as the event loop advances — purpose-built for students learning async JS for the first time and covering Promise and async/await semantics that older visualizers miss.
What it would do
JS Event Loop Visualizer builds on the insight behind Philip Roberts' JSConf 2014 talk and the loupe.rocks tool: the best way to teach async execution is to make the event loop visible. This project delivers a modern, maintained alternative with a wider feature set. Users paste a JavaScript snippet into an editor panel, then step through execution using playback controls. On each step, four animated panels update simultaneously: the call stack (functions push and pop), the Web APIs register (timers count down, fetch requests pend), the microtask queue (Promise.then and async/await continuations), and the macro-task callback queue. An event-loop shuttle animates moving the next task onto the call stack when it empties. A source highlight traces which line of code corresponds to the current step. The key pedagogical gap this fills: loupe.rocks does not model microtasks or Promise resolution order, so students cannot use it to understand why Promise.resolve().then fires before setTimeout(fn, 0), or why async/await compiles to a chain of microtask-queued continuations. An embedded library of 15 runnable annotated examples covers the full async JS curriculum: setTimeout basics, clearTimeout, chained promises, Promise.all, async/await, fetch error handling, and the microtask-vs-macrotask ordering puzzle. An embeddable iframe widget mode lets instructors link to a specific example at a specific playback step directly from course notes.
Key features
- Step-by-step playback: advance or rewind one event loop tick at a time with a scrubable timeline bar
- Four animated panels: call stack, Web APIs register, microtask queue (Promise/async), and callback queue
- Source highlight: current executing line in the editor highlighted on every step
- 15 curated annotated examples covering setTimeout, clearTimeout, chained promises, async/await, and fetch
- Embeddable iframe widget mode: instructors link to a specific example at a specific step from course slides