#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