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.
Task queue
task
Call stack