# Is window really global in Javascript?

Take this piece of Javascript in a browser: <script> console.log(window.someThing); var x = 12; function foo() { window.otherThing = x; } </script>Inside foo we can access window, we all know that, but why exactly?- Is it some kind of special global variable?- Or does the "root scope" (inside the script tag) have it as an implicit local variable and is it simply "closure-inherited" as any other local variable (like x above) can be?And how does that concur with variables declared directly inside the script tag being set as properties of window? (Or is that not so?) <script> var x = 12; function() { console.log(window.x); } </script>

By: