is there a way to access a non-global shadowed variable in javascript
问题 I'm currently learning javascript scope and was just wondering whether it is possible to access a non-global shadowed variable in javascript? i.e. in the example below, the variable a that equal to 10 in the aFunc function var a = 1; function aFunc(){ var a = 10; function innerFunc(){ var a = 100; console.log("innerFunc a = " + a); console.log("is it possible to access outer function's a variable?"); console.log("global a = " + window.a); } innerFunc(); } aFunc(); ps - I understand naming