function declaration
🚧 施工中
Last updated
Was this helpful?
🚧 施工中
Last updated
Was this helpful?
⟩ ⟩ function declaration
⟩ ⟩ ⟩ ⟩ declaration
function declaration vs. variable declaration
function declaration is instantly fully initialized.
variable declaration is assigned undefined initially. ( hoisting)
📗 JS.info ⟩
in sloppy mode: and visible outside the block
in strict mode:local to the block
function declaration in the global scope
also expose themselves as global object property. global var / function is global object property❗️
function declaration instantiation
When an is established for evaluating an ECMAScript function:
a new is created and bindings for each formal parameter are instantiated in that .
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 as the parameters
If default value initializers exist, a second is created for the body declarations
📘 JS spec ⟩
JS.info ⟩
⟩