Scope
↔ Placewhere Variable is declared
Variable declare inside function store in VE of function's EC
Global Scope
Outside any Block. Variableaccess everywhere
Block Scope
Variable Lookup restrict to inside of Block
Function Scope
Variable access restrict to only inside function body.
(For functions) VE is same as Scope
Scope of a variable
Region of code where Variable can be accessed
!recall since JS has First-Class Functions - functions are just values stored in variables
References
TDZ
↔ Region of Code outside Scope of a variable, variable uninitialized from Scope start to DeclarationScope Chain
↔ Link to Variable from outer Scopes to current ScopeLexical Environment
↔ current Scope environ where JS Engine read CodeDependency
↔ any Variable local to FC Scope to control Hook Trigger