This is the fourth article in a series on how JavaScript actually runs. You can read the full series here or on my website.




In the last article, we established a precise rule:


Once a macrotask finishes, JavaScript drains all microtasks before selecting the next macrotask.


Microtasks like Promises are continuations that must complete before...