Event Loop

Microtask starvation

Because microtasks fully drain before anything else, a microtask that keeps scheduling more microtasks never lets the loop reach the task queue or a render — starving them.

A .then() that always schedules another .then() blocks all timers and painting.

Microtask queue
.then()
Call stack
Task queue
render
Watch microtasks starve the queue

One of 40 cards in the JavaScript deck. Browse every card.