来来来,总结一波ES5的原型继承
Function.__proto__ === Function.prototype //true 特殊
Function.__proto__ === Object.__proto__ //true
Object.__proto__.__proto__ === Object.prototype //true
Array.__proto__ === Function.prototype //true
String.__proto__ === Function.prototype //true
Number.__proto__ === Function.prototype //true
Boolean.__proto__ === Function.prototype //true
(123).__proto__ === Number.prototype //true会形成包装类,和new Number(123)一样
("123").__proto__ === String.prototype //true
(true).__proto__ === Boolean.prototype //true
([]).__proto__ === Array.prototype //true
Number.prototype.__proto__ === Object.prototype //true
String.prototype.__proto__ === Object.prototype //true
Boolean.prototype.__proto__ === Object.prototype //true
Array.prototype.__proto__ === Object.prototype //true
其实Number.prototype就是一个Object实例对象,而Object实例对象的__proto__指向Object.prototype
({}).__proto__ === Object.prototype //true 特殊