Question: Question 3 Consider the following JavaScript program with static - scoping: var x = 1 , y = 2 ; function sub 1 ) {

Question 3
Consider the following JavaScript program with static - scoping:
var x=1, y=2;
function sub1){
var a=3, z=4;
var m=y;
function sub20{
var a=5,y=6;
p=x;
~.\
}
~.\
}
function sub3(){
var a=7, w=8;
var q=y;
}
Answer the questions:
What is the value of z in sub10?
What is the value of y in sub10?
What is the value of a in sub20?
What is the value of x in sub20?
What is the value of a in sub30?
What is the value of y in sub30?
Question 3 Consider the following JavaScript

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!