Question: Consider the following code segment. The function big calls sub1 which calls sub2 which uses x. What would the value of x be with Static
Consider the following code segment. The function big calls sub1 which calls sub2 which uses x.

What would the value of x be with Static scoping? The reference to x in sub2 is big's x.
What would be the value of X be with Dynamic scoping? The reference to x in sub2 is sub1's x.
Explain the difference between first, second, and third class values. How does passing a function as an argument fits into these values?
function big) big calls subl sub1 calls sub2 sub2 uses x function sub1) varx7 function sub2) { vary x, function sub30 var x-10 varx 3; function big) big calls subl sub1 calls sub2 sub2 uses x function sub1) varx7 function sub2) { vary x, function sub30 var x-10 varx 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
