i have declared global variable as follows:
var glob = "smiley";
However i want to call it from inner scope of 3 functions. Like this:
// Global is finally found!
(function(){
// glob not found, then browser searches upwards
(function(){
// glob not found, then browser searches upwards
(function(){
var joe = glob;
var win = window;
})();
})();
})();
Since window is a javascript keyword, it is taken from global scope directly, without searching outer scopes? And is there any efficient way how to call a global variable in Javascript directly? Without searching in all previous scopes?