JavaScript's scope system is called "lexical scope"
JS ⟩ concepts ⟩ scope ⟩ lexical scope
🈯 synonyms: "static scope"
JavaScript's scope is determined at compile time; the term for this kind of scope is "lexical scope". ("lexical" is associated with the lexing stage of compilation)
👉 compare: static vs. dynamic scoping
scope / scope chain
lexical environment
JavaScript is largely lexically scopedarrow-up-right, meaning that functions can access variables defined in their surroundings. 👉 see: RingoJSarrow-up-right
static scope: C, Java, JavaScript, Python and Ruby.
dynamic scope: Perl.
YDKJS: Scope & Closures (v.2) ⟩ Ch. 1
Wikipedia ⟩ lexical scope vs. dynamic scopearrow-up-right
ringojs ⟩ Understanding module and global scopearrow-up-right ⭐️
Anil ⟩ Scope, Lexical Environment and Scope Chain in JavaScriptarrow-up-right ⭐️
Last updated 3 years ago