January 2020
Intermediate to advanced
548 pages
13h 36m
English
A variable declaration occurs via a var keyword followed by a valid identifier or an assignment of the form a = b:
var foo;var baz = 123;
Variables declared via var are scoped to the nearest function, module, or global environment—that is, they are not block-scoped. At parse time, variable declarations within a given scope will be collected and then, at the point of execution, those declared variables will be hoisted to the top of their execution context and initialized with the undefined value. This means that, within a given scope, ...
Read now
Unlock full access