Hello friends I was stuck with the following code output.
x = 1;
var a = 5;
var b = 10;
var c = function(a, b, c) {
var x = 10;
document.write(x);
document.write(a);
var f = function(a, b, c) {
b = a;
document.write(b+"\n");
b = c;
var x = 5;
}
f(a,b,c);
document.write(b);
}
c(8,9,10);
document.write(b);
document.write(x);
the expected output is : 10 8 8 9 10 1 but was confused with the output why the value of b in 10 8 8 9 10 1 is not 9. How the value of b got 10 instead. Please help me to understand the concept.