function User(){} User.__proto__.view=function(){ console.log("user function"); } User.prototype.show=function(){ console.log("后盾人"); } user.view(); console.dir(User); // __proto__服务于函数对象的 // prototype服务于函数实例化的 let hd=new User(); hd.show();
function User(){} User.__proto__.view=function(){ console.log("user function"); } User.prototype.show=function(){ console.log("后盾人"); } user.view(); console.dir(User); // __proto__服务于函数对象的 // prototype服务于函数实例化的 let hd=new User(); hd.show();