Glossary term
What is lexical environment? Meaning for developers
A context's own memory plus a reference to the memory of the context it was written inside. “Lexical” means “decided by where the code sits in the file”.
Learn it properly · JavaScript CoreLesson 7: Scope Chain and Lexical EnvironmentLesson 4 showed one function looking outward to Global. This lesson extends that into a full chain — as many levels deep as your code is nested — and gives it a proper name: lexical scope, decided entirely by where you physically wrote your code, never by which function called which.