It is added to one of window's properties when you define global variable.
var foo = 'foo';
console.log(window.foo);
//result : 'foo'
As you know, The scope of the JavaScript variable is function.
For global variables to be stored, I must use a function because of scope.
But it is not a global variable already if I wrap the variable by a function.
You can't help but add to window's properties in my opinion.
However, the guess is just a guess.
I've always wondered why it is happened.
But I don't still know why.
Is there anyone who know why?