JavaScript that runs in the browser has Window as it's top level. This means that global variables will become properties of window:
// this code is not inside a function
var global1=22;
function test(){
var local=88;
window.global2=99;
console.log(local);//logs 88 because
// local is available within the body
// of this function
console.log(global1);//logs 22
}
console.log(typeof local);//logs undefined becaue were
// outside the funciton body
test();
console.log(global2);//logs 99 because we added
// global2 as a property of window
So window will contain all your global objects, this means that:
parseInt does the same as window.parseInt.
Window even contains itself so:
window===window.window.window;//is true
window does not have a getElementById, children, childNodes ... funciton because window is not an Html element and document is.