Answer
Lexical scope means identifier visibility is determined by source-code nesting.
β’ A functionβs outer environment is chosen where the function is created.
β’ Calling the function elsewhere does not change that lexical parent.
β’ Closures depend on lexical scope.
Example
Code
const name = 'outer';
function show() { console.log(name); }
show();Output
outer
Quick Revision
Lexical scope follows code nesting, not the caller location.