What the heck is the event loop anyway? | Philip Roberts | JSConf EU
Why Hacker News recommends it
HN commenters repeatedly name it as the best explanation of the JS event loop and the first thing to watch before tackling async code.
What it is
Philip Roberts explains the JavaScript event loop, call stack, callbacks and asynchronous behavior with live visualizations using a tool he built. It demystifies terms like non-blocking and single-threaded.
Recommended by 16 HN commenters across 14 different months, 2015 to 2025.
What Hacker News said
Strong rec lollipop25 · 2016-03 · on “Ask HN: How do I go about truly “understanding” JavaScript, or any language?”
> How do I take, say JS, and learn it to the point where it really clicks to the point where I can visualize what's going on under the hood when I write programs? Learn how a JS engine works. Any engine will do, although V8 is very discussed on the internet. Here's a few things to get started with: - How the event loop works ( [this video] ). This show how JS works under the hood, what's part of "JS" and what's extended, how async operations are scheduled on a single thread. After watching this, everything will just "click". - How objects are represented in V8 ( [LINK] ). It's v8-specific but nevertheless tells you how objects are represented in memory. Keeping these concepts in mind, you will be
Strong rec zappo2938 · 2016-10 · on “Understanding Async JavaScript”
The corner stone of understand async JavaScript code is a deep understanding what happens under the hood with the Event loop. Philip Roberts has a great lecture called what the heck is the event loop anyway? [1] Once that video is watched once, everything else just makes sense. [1] [this video]
Strong rec keyvin · 2018-10 · on “Ask HN: What are some of the best technical talks you've heard?”
Another event loop talk from Philip Roberts. The tool he created to display the event loop in real time is fantastic. [this video]
Strong rec _bxg1 · 2020-02 · on “Ask HN: How do I learn JavaScript?”
I got to know the nuances of the language by working with it for years and having to figure out why various things didn't work at different points, but it doesn't sound like that's your style. This isn't comprehensive, but it's probably the most helpful deep-dive I've ever seen about some aspect of JavaScript. It's about the Event Loop, which is one of the biggest differences between JS and comparable languages like Python: [this video] Contrary to what you might think, even though the event loop is in some sense "distinct from the language", it isn't simply an API. You can't really have JavaScript without the event loop; it exists in both the browser and in Node, and is the basis for most of the
Strong rec krisgenre · 2020-11 · on “How does the event loop work in JavaScript? [video]”
This one is my all time favorite - What the heck is the event loop anyway? | Philip Roberts | JSConf EU [this video]
Recommends the_cat_kittles · 2015-03 · on “JavaScript Call Stack/Event Loop Visualization”
i cannot believe i didn't have the mental model outlined in this video (the intro video to the site) after developing for the web for so long. [this video] ...a great, very simple explanation.
Recommends hackaflocka · 2016-10 · on “Ask HN: What's your favorite tech talk?”
Paul Buchheit - Startup School Europe 2014 [LINK] Anjana Vakil: Learning Functional Programming with JavaScript - JSUnconf 2016 [LINK] Bret Victor - Inventing on Principle [LINK] Philip Roberts: What the heck is the event loop anyway? | JSConf EU 2014 [this video]
Recommends mxschumacher · 2018-07 · on “Ask HN: What you wish you'd known before getting into JavaScript?”
Be sure to understand the event loop. Javascript as an asynchronous language often comes back to bite beginners. Here are two great talks to help you: [LINK] [this video] Your life will be easier if you learn to use Chrome Dev tools (or the Firefox equivalent) early. In the beginning, you don't have to worry about browser compatibility - embrace modern JS (ES6+)!