Double nesting a function-valued return stops from entering the double nested function
问题 Trying to understand the scope chain and execution context stack articles from David Shariff's Blog, I've tried to understand closures here function foo() { var a = 'private variable'; return function bar() { alert(a); } } var callAlert = foo(); callAlert(); // private variable I just wanted to test if inner function has the variable object just from its parent or from the whole scope chain, so I added a nested function repeating the example: function foo() { var a = 'private variable';