Question: Consider the following quasi-Javascript code:var x;function sub1() {print(x)x = 20}function sub2() {var x;x = 40;sub1();}x = 9;sub2();a)If this code were run with static scoping, what
Consider the following quasi-Javascript code:var x;function sub1() {print(x)x = 20}function sub2() {var x;x = 40;sub1();}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
