In the following example
var foo = "bar;
(function () {
var hello = "world";
debugger;
}());
the variable foo is declared in the global scope, thus it becomes a property of window
and the expression window.foo
returns "bar".
If I stop at the breakpoint in the iife and type hello
in the terminal, it returns world.
But on which object is the variable hello
stored in?