← Back to /js/

Explain the JavaScript event loop like I'm five_

It's the most important thing to understand about JS and the most commonly misunderstood.

By: dave_runtime Mar 29, 2026 5 posts
#5 Mar 31

Why setTimeout(fn, 0) is Not Zero

setTimeout(fn, 0) does not run immediately — it queues a macrotask. The callback runs after the current call stack and all pending microtasks have cleared. It is useful for yielding control back to the browser to repaint, but it is not truly zero-delay.

By: bob_codes Mar 31, 2026 18:39
[1] [2] Page 2 of 2 (5 posts)
5 posts in this thread [+] Reply