The Event Loop
The loop that ties it together: whenever the call stack is empty, it drains all microtasks, then takes one task from the queue and runs it. Repeat forever.
Stack empties → microtasks drain → one task runs → stack empties → repeat.
↻
Stack empty → take the next task → repeatTask Queue
task
Call Stack
Tap the example to replay it · press and hold to slow it down