What is the opposite approach to the lexical scoping?
A
Literal scoping
B
Static scoping
C
Dynamic scoping
D
Generic scoping
Correct Answer: Dynamic scoping
The opposite approach to the lexical scoping is the dynamic scoping. Dynamic scoping does not care how the code is written, but instead how it executes. Each time a new function is executed, a new scope is pushed onto the stack. This scope is typically stored with the function’s call stack. When a variable is referenced in the function, the scope in each call stack is checked to see if it provides the value.