📜var
🚧 under construction
Last updated
Was this helpful?
🚧 under construction
Last updated
Was this helpful?
Was this helpful?
Stop using var❗ ( 👉see why❗)
( ⭐ var is a statement, not a declaration❗)
declares a variable in function scope / global scope ( and does a lot of side effects❗).
JS is lenient with , strict with .
, even in ❗
in ,
var / are implemented as ❗
Variable Statement
var statement declares variables that are scoped to the 's VariableEnvironment.
these properties cannot be deleted with delete❗
Within the scope of any VariableEnvironment a common BindingIdentifier may appear in more than one VariableDeclaration but those declarations collectively define only one variable.
A variable defined by a VariableDeclaration with an Initializer is assigned the value of its Initializer's AssignmentExpression when the VariableDeclaration is executed, not when the variable is created.