Variable Object (VO): includes variables and function declarations. function expression will not be included in the VO
Activation Object (AO): include VO + function arguments
In ES5, the VO and AO is combined into the lexical environments.
before we go to the __parent__ (upper context), first __proto__ chain is considered
Closure : Scope chain = Activation object + [[Scope]]
The value of this is determinate only once when entering the context.
What really happen for hoist is: when execution engine is preparing the ‘execution context’ for the current function call, it will make global-context + this + outer-ev + local-vars ready. So it will scan the function body first and try to find out the variable and function declarations and prepare memory placeholders for them. After that it would start executing(interpreting) the function line by line. As a result, it makes the illusion that all the variables are ‘Hoisted’ to the top.