❗var is a statement❗️
🚧 under construction
Last updated
Was this helpful?
🚧 under construction
Last updated
Was this helpful?
Was this helpful?
JS ⟩ variable ⟩ var ⟩ var is statement❗
(side effects)
var is a statement, instead of a declaration:
it doesn't follow normal lexical scoping rules.
may create side effects:
📘 JS spec ⟩ Variable Statement
var statement declares variable(s) that are scoped to the running execution context's VariableEnvironment.
var (s) are created when their containing is instantiated and are initialized to when created.
Within the of any VariableEnvironment a common may appear in more than one but those declarations collectively define only one .
A defined by a with an is assigned the value of its 's when the is executed, not when the variable is created.