Now my question is when that hidden reference created? And the hidden reference have the references of all local variables of outer function. Now my second question..
If any variables local to a loop scope are also being referenced by hidden pointer. But those variables get destroyed after loop scope ends up, how it gets handled?
Now have a look at code snippet....
Expand|Select|Wrap|Line Numbers
- function outer(){
- var var1 = some_value;
- var inner = function(){some_code;}
- return inner;
- }
so the reference of inner variable being referenced by hidden pointer or only variable var1?
I think experts can get my point of view.
Please answer these questions!