Question: Given the following code: function big ( ) { function sub 1 ( ) { var x = 7 ; } function sub 2 (

Given the following code:
function big(){
function sub1(){ var x =7; }
function sub2(){ var y = x; }
var x =3;
}
If the language employed
dynamic
scope rules for its variables, then the value of the variable y in sub2 would be defined by the spacial relationship and would result in the value of
[ Select ]
. If the language employed
dynamic
scope rules, then the value of the variable y would depend on the order of calls: if sub2 were called from big, then it would be
[ Select ]
, if sub2 were called from sub1, it would be

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!