var can shadow parameter even in strict mode❗️

🚧 under construction

JSvariableshadowing ⟩ var can shadow parameter even in strict mode.

parameter(s) can be shadowed by var

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 specFunctionDeclarationInstantiation

Last updated