This article is part of a series on the JavaScript event loop.




Most explanations of JavaScript's event loop start with:


JavaScript is single-threaded.


This statement is technically true but doesn't explain certain behaviors in JavaScript you may have noticed:



setTimeout doesn't interrupt loops after the timer has run out

setTimeout...