Scope
Every function and block ({
... }
) introduces a new scope for declarations. Each function and block can refer to declarations in its scope or any of the outer scopes.
Each scope can introduce new declarations, i.e., the outer declaration is shadowed.
Scope is lexical, not dynamic.
Declarations are not moved to the top of the enclosing function (hoisted).
Last updated