Part 1: The Question Tutorials Skip
What no one teaches you about the JavaScript Event Loop — Part 1 of 8 A puzzle to start Open any page in your browser. Open DevTools, go to the console, and paste this: document.body.addEventListener
Search for a command to run...
Series
A first-principles walk through the JavaScript event loop. Threads, kernel scheduling, epoll, V8 as a library, the HTML spec algorithm, Promise internals, and why await is a state machine — covered mechanically, with the assumption that the reader wants to understand, not memorize.
What no one teaches you about the JavaScript Event Loop — Part 1 of 8 A puzzle to start Open any page in your browser. Open DevTools, go to the console, and paste this: document.body.addEventListener
What no one teaches you about the JavaScript Event Loop — Part 2 of 8 A new puzzle In Part 1, an infinite loop froze the page. The click vanished. We left with a question: what does "JavaScript is si
What no one teaches you about the JavaScript Event Loop — Part 3 of 8 A different puzzle In Part 2 we left a question hanging. An idle browser tab uses zero CPU. Open your task manager — a tab with n
What no one teaches you about the JavaScript Event Loop — Part 4 of 8 A puzzle in DevTools Open any page in your browser. Open DevTools. Click the Performance tab. Hit the record button (the circle).