📘function declaration instantiation
🚧 under construction
JS ⟩ value ⟩ function ⟩ declaration ⟩ instantiation
🚧
⭐ function declaration instantiation
When an execution context is established for evaluating a function:
a new Function Environment Record is created.
bindings for each parameter are instantiated in that Environment Record.
body declarations are also instantiated:
⭐ if the parameters do not include any default value initializers: the body declarations are instantiated in the same Environment Record as the parameters❗(👉 parameter scope)
⭐ if default value initializers exist:
a second Environment Record is created for the body declarations❗
parameter(s) / function(s) are initialized as part of FunctionDeclarationInstantiation. All other bindings are initialized during evaluation of the function body.
Last updated