โvar can shadow parameter even in strict modeโ๏ธ
๐ง under construction
JS โฉ variable โฉ shadowing โฉ var can shadow parameter even in strict mode.
โญ function declaration instantiation
When an execution context is established for evaluating an ECMAScript function๏ผ
a new Function Environment Record is created and bindings for each formal parameter are instantiated in that Environment Record.
Each declaration in the function body is also instantiated.
If the function's formal parameters do not include any default value initializers then the body declarations are instantiated in the same Environment Record as the parameters โ
If default value initializers exist, a second Environment Record is created for the body declarations โ
Formal parameters and functions are initialized as part of FunctionDeclarationInstantiation. All other bindings are initialized during evaluation of the function body.
๐ JS spec โฉ FunctionDeclarationInstantiation
Last updated