- constructor
- toString()
- toLocaleString()
- valueOf()
- hasOwnProperty()
- isPrototypeOf()
- propertyIsEnumerable()
以上属性不可枚举,不可删除,并且只读。那么,它们由谁提供?没错,它们来自 Object.prototype。
ECMAScript 语言规范的提法十分明确:
The initial value of Object.prototype is the Object prototype object.
“the Object prototype object”就是 Object.prototype 的“标准名称”,够囧吧。这还没完,继续考察这个 the Object prototype object:
The value of the internal [[Prototype]] property of the Object prototype object is null and the value of the internal [[Class]] property is “Object”.
规范指出,在引擎内部,这个对象的 [[Prototype]] 属性指向空,于是可以知道,它已经处于原型链的顶层,而为了对象系统的完备性,自身还是有一个 [[Prototype]] 内部属性,并指向同为“Object Type”的 NULL。
至此,原型链系统完美地画上一个句号。我们做一个总结:JS 1.x 中,Object 是顶层构造器,Object.prototype 是顶层对象实例,同时也是原型链的祖宗,同时,我们尊称这位祖宗为“the Object prototype object”!