Lexical Scope in JavaScript – Beginner’s Guide
- Author:: freecodecamp.org
- Category:: article
- URL:: https://www.freecodecamp.org/news/lexical-scope-in-javascript/
- Rating:: 4
Learn by elaboration
- Lexical Scope is the process of assigning scope for the variables/functions in the parsing phase in runtime. There are 2 phases to any language, parsing and execution.
- When reading a variable, the compiler first checks the current scope, then the parent, then the parents parent until it hits global scope, which, if there is no definition of the variable/function, an error is thrown.
📇Additional Metadata
- 📁Type::resource
- 📎Source::article
- 🏷️ Tags:: Javascript, Programming
- 📡 Status::🌲