JS under the hood Some notes I took while trying to understand how JS works under the hood. The snippet of code can be easily executed here: http://jsbin.com/?js,console Table of contents Executions contexts, Lexical environments, scopes Syntax parser Lexical environment Execution context Creation and hoisting Functions invocation and execution stack Variable scope Scope chain Handling asynchronicity Types and operator Primitive types Precedence and associativity Coercion Comparison Operators Particular cases of coersion Objects and functions Key value pairs: Object Functions By reference Vs by value "This" Arrays Parameters IIFEs Closure Closures and Callbacks call(), apply() and bind() OO JS and prototypal Inheritance