so ... I'm trying to learn this new thing called closure ... new for me ... Out of academic interest:
DESCRIPTION
When I create a global variable or function in JS - I can easily see them on the Firebug DOM tab (they are attached to the Window object). When I create objects - the same story. I see objects on the Firebug DOM tab.
Question:
What about variables and functions inside closures - what are they attached to? I do not see these private variables in the Firebug DOM tab. So should it work?
(function () {
var test1 = 'test';
function test2(){
}
}());
source
share