Question: What is the final value for x in function f3, in the following Dynamically Scoped example, assuming that function f1 was called with the following
What is the final value for x in function f3, in the following Dynamically Scoped example, assuming that function f1 was called with the following parameter values (10, 20)?
var x = 5;
var y = 6;
function f1(p1, p2) {
var x = 10;
var y = 20;
f2(p1, p2);
}
function f2(p1, p2) {
var x = 11;
var y = 21;
f3(x, y);
}
function f3(p1, p2) {
var x = y + p1 + p2;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
