Question: 3. (15 points. Consider the following quasi-Javascript code: var x; function subi() { print (x) x = 20 } function sub2() { var x; x

3. (15 points. Consider the following quasi-Javascript code: var x; function subi() { print (x) x = 20 } function sub2() { var x; x = 40; subl(); } x = 9; sub2(); a) If this code were run with static scoping, what value would be printed? b) If this code were run with dynamic scoping, what value would be printed
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
