Event Loop

Blocking the main thread

Long synchronous work keeps a frame on the stack, so the loop can't reach queued tasks or repaint. Clicks, script-driven animations, and rendering freeze until it finishes; compositor-only animations (transform, opacity) and scrolling can keep going.

A heavy while-loop makes the page unresponsive until it's done.

UI: live
Call stack
Task queue
Watch long sync work freeze the page

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