94-原型面试题 发表于 2019-06-15 | 分类于 前端-02-js基础复习 | 1234567891011121314151617181920212223242526272829var P=function(){};P.prototype.aaa=function(){ console.log('ddd');}var a=new P();var b=new P();b.prototype=P;b.prototype.aaa=function(){ console.log('ccc');}var c=Object.create(null);var d=new Object();console.log(P.__proto__ === Function.prototype);console.log(P.prototype);console.log(a.__proto__ === P.prototype);console.log(a.prototype);console.log(b.prototype);console.log(c.__proto__);console.log(d.__proto__ === Object.prototype);console.log(Number.__proto__);console.log(Number.prototype);console.log(Function.__proto__ === Function.prototype);console.log(Function.prototype);console.log(Function.prototype.__proto__ === Object.prototype);console.log(Object.__proto__ === Function.prototype);console.log(Object.prototype);console.log(Object.prototype.__proto__);