Assume the following JavaScript program was interpreted using staticscoping rules. What value of x is displayed in function sub1? Under dynamic-scoping rules, what value of x is displayed in function...


Assume the following JavaScript program was interpreted using staticscoping rules. What value of x is displayed in function sub1? Under
dynamic-scoping rules, what value of x is displayed in function sub1?
var x;
function sub1() {
document.write("x = " + x + "");
}
function sub2() {
var x;
x = 10;
sub1();
}
x = 5;
sub2();



Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here