๐ฐscope
๐ง under construction
JS โฉ scope
( visibility of variable)
the current context of execution in which values and expressions are "visible" or can be referenced.
concepts about scopes
lexical environment - stores local variables/functions/this.
kindes of scopes
top-level scope - the scope of a JS file.
global scope๏ผ default scope for all code running in script mode.
module scope๏ผ scope for code running in module mode.
function scope๏ผ scope created with a function.
block scope๏ผscope created with a pair of curly braces. (where let / const can belong to)
special scopes
function name scope - where name of function expression lives in.
"for-init" scope - where the for loop initialization variables live in.
Last updated