# The Event Loop, in Pictures

The call stack runs one function at a time, finished timers wait their turn in the task queue, and the event loop moves the next one onto the stack only when the stack is empty, which is why setTimeout(fn, 0) runs after the code around it.

![Cheat sheet: The Event Loop, in Pictures](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/10/7357fd22923d4d5eb2b9be575dacdfa5.webp)

- Category: JavaScript
- Level: Journeyman
- Tags: Call Stack, Callback Hell, Event Loop (javascript), JavaScript, Run-to-Completion, Task Queue
- Updated: November 1, 2026

Source: https://www.ask-codey.com/cheat-sheets/javascript-async-basics-the-event-loop-cheat-sheet
