Microtasks: Why Promises Run First
21 April 2026
Why do Promises always run before setTimeout? This article reveals microtasks as mandatory continuations that must run before JavaScript moves on.
Writing to understand how things work
21 April 2026
Why do Promises always run before setTimeout? This article reveals microtasks as mandatory continuations that must run before JavaScript moves on.
15 April 2026
If nothing can interrupt JavaScript, when does anything else run? This article reframes tasks as entry points into execution, not chunks of work.
6 April 2026
Why doesn’t setTimeout interrupt your code? This article breaks the illusion: JavaScript runs synchronously, and async APIs don’t interrupt. Instead, they schedule.
6 April 2026
JavaScript’s event loop often feels magical—until it breaks your expectations. This series builds a precise mental model of how JavaScript actually runs, from tasks and microtasks to rendering and real UI behavior.