先看代码
[code]
alert(typeof null); //object
alert(typeof Object.prototype); //object
alert(null instanceof Object); //false
alert(Object.prototype instanceof Object); //false
[/code]
从结果可以看出,null和Object.prototype都不是对象。
[code]
alert(typeof Function.prototype);
alert(Function.prototype instanceof Function);
[/code]
这也是个特例,也就是说Function.prototype并不是个Function
[code]
alert(typeof null); //object
alert(typeof Object.prototype); //object
alert(null instanceof Object); //false
alert(Object.prototype instanceof Object); //false
[/code]
从结果可以看出,null和Object.prototype都不是对象。
[code]
alert(typeof Function.prototype);
alert(Function.prototype instanceof Function);
[/code]
这也是个特例,也就是说Function.prototype并不是个Function