It is very easy! All global variables in JavaScript are actually a child attribute of the "window" object, so declaring a variable in the addition of a global scope makes this variable an attribute of the window object. From an anonymous function, you can put "c" or other variables in the global scope simply by doing the following ...
window.c=b+a; alert(c); // Same!
Enjoy :)
source share