In chapter 4 of Professional JavaScript for Web Developers by Nicholas C. Zakas, author says that function arguments follow the same access rules as any other variable in the execution context. For that, I tested the follows code:
function n1(num1, num2) {
function n2() {
var num3 = (num1 + num2);
console.log(num3);
}
}
I called n1() function with: n1(1, 2). I thought that the result would be 3, but I get undefined.
Why this behavior?