Question
Consider the following JavaScript skeletal program: function main() { var a, b, c; function sub1() { var x, y, w; function sub2() { var a,
Consider the following JavaScript skeletal program:
function main() { var a, b, c; function sub1() { var x, y, w; function sub2() { var a, d; ... } ... } function sub3() { var c, u, z; ... } }
a. List all the variables, along with the program units (sub1, sub2, sub3, or main) where they are declared, that are visible in the body of main, assuming static scoping is used. b. List all the variables, along with the program units (sub1, sub2, sub3, or main) where they are declared, that are visible in the body of sub1, assuming static scoping is used. c. List all the variables, along with the program units (sub1, sub2, sub3, or main) where they are declared, that are visible in the body of sub2, assuming static scoping is used. d. List all the variables, along with the program units (sub1, sub2, sub3, or main) where they are declared, that are visible in the body of sub3, assuming static scoping is used.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started