Blocking the Main Thread
Long synchronous work keeps a frame on the stack, so the loop can't reach queued tasks or repaint. Clicks, animations, and rendering all freeze until it finishes.
A heavy while-loop makes the page unresponsive until it's done.
UI: live
Call Stack
Task Queue
Tap the example to replay it · press and hold to slow it down