Things I wish someone had drawn out for me when I was starting with JavaScript. A lot of engineers write JS for years without really knowing what happens after they hit run. How does the code actually execute? What's the JS engine doing? Why does async code behave the way it does? Why does setTimeout sometimes feel unpredictable? It all makes sense once you see the full picture. Here's what these notes cover: The JS Runtime Environment — engine, call stack, memory heap, and how execution contexts are created and destroyed. The Event Loop, how it continuously monitors the call stack and decides what runs next. Callback Queue vs Microtask Queue, why Promises behave differently from setTimeout, and why microtasks always go first. JIT Compilation, how V8 interprets and optimises your code on the fly. Web APIs and the Browser, where setTimeout, DOM APIs, fetch, and localStorage actually live. Once this clicked for me, a lot of "weird" JavaScript behaviour stopped feeling weird. If you're learning JS right now, save this. Come back to it when async starts feeling confusing. What part of JavaScript took you the longest to truly understand? #JavaScript #WebDevelopment #Frontend #LearnToCode
This and prototypes
Saved this. The event loop was the thing that took me the longest — especially understanding that JS isn't async by itself, the browser is doing the heavy lifting through Web APIs. Would love to see a follow-up on how the microtask queue interacts with async/await under the hood.