Arindam Paul - JavaScript VM internals, EventLoop, Async and ScopeChains
Why Stack Overflow recommends it
Stack Overflow users link it in answers about closures, hoisting and scoping when they want to show how the JavaScript runtime compiles and executes code.
Recommended by 3 people across 3 different months, 2015 to 2020.
What it is
A 38-minute conference talk from JSFoo 2015 by Arindam Paul on how the JavaScript VM works. It covers the single-threaded event loop, blocking versus non-blocking code, ES6 generators for async signaling, scope chains, closures, and how event listeners register and deregister.
What people said
Recommends Nikhil Ranjan · 2015-12 · Stack Overflow · on “How do JavaScript closures work?”
To understand closures you have to get down to the program and literally execute as if you are the run time. Let's look at this simple piece of code: [LINK] JavaScript runs the code in two phases: Compilation Phase // JavaScript is not a pure interpreted language Execution Phase When JavaScript goes through the compilation phase it extract out the declarations of variables and functions. This is called hoisting. Functions encountered in this phase are saved as text blobs in memory also known as lambda. After compilation JavaScript enters the execution phase where it assigns all the values and runs the function. To run the function it prepares the execution context by assigning memory from th
Recommends Arun Redhu · 2017-09 · Stack Overflow · on “Lexical Scoping Issue”
hoisting is done during the compilation part and compilation of bar function is not done until it is called. So why bar should display error. If you further want to know the details about how javascript is compiled or executed. Here is a nice video [this video]
Recommends Ernesto · 2020-05 · Stack Overflow · on “Is an anonymous function as a parameter a function declaration or a function expression?”
# Response if you really what to know that you need to have a clear understanding of how the javascript runtime engine works. ## Detailed Video [this video]