当js解释器启动的时候,会创建一个全局对象,包含一些重要的初始属性如下
- 全局属性,undefined,Infinity和NaN
- 全局函数,parseInt()
- 构造函数,Object(),RegExp()
- 全局对象,Math和JSON
在客户端js中,window对象充当了全局对象的超级。并且有一个window属性引用自身。
function Window () {
this.window = this;
var window = this.window;
...
};
window = {
....
};
Window.call(window);