Question: Consider the following JavaScript program function sub1 () {var x function sub2 () {// creates a popup box with the value of x alert(x);}; function
Consider the following JavaScript program function sub1 () {var x function sub2 () {// creates a popup box with the value of x alert(x);}; function sub3 () var x; x = 3; sub4(sub2);}; function sub4(subx) var x; x = 4; subx ();}; x = 1; sub3();} |sub1 (); Give the output of this program when executed using (a) deep, (b) shallow, and (c) ad-hoc binding
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
