JavaScript inner function scope chain?
- by Ding
In this example
var a = 1;
( function(x) {
function inner() {
alert(a);
alert(x);
alert(y);
}
var y = 3;
inner();
})(2);
When does function inner get created? during execution time or parsing time of outer anonymous function?
What is in the scope chain of function inner?
What is in the execution context of function inner?
I know it is not a simple question, thanks for enlighting me in advance!