Watch how JavaScript runs your code, one step at a time

Paste some code, then press Start to see it flow through the call stack, Web APIs, queues and the event loop. Or step through each move yourself.

Your code

Result

console output

Call Stack

runs one frame at a time

Web APIs

timers wait here

Event Loop

idle
Press Start or Next step to begin.

Callback Queue

timers and promise jobs

Call Stack

Holds the function being run. A new call goes on top and leaves when it returns.

Web APIs

Async work such as timers happens outside the stack. When it finishes, the callback is queued.

Callback Queue

Finished timer callbacks wait here. Promise jobs are served first.

Event Loop

Watches the stack. When it is empty, it moves the next waiting job onto it.