function User(name,age){ this.name=name; this.age=age; } User.prototype.show=function(){ console.log(this.name,this.age); } function Admin(...args){ //改变this的指向 User.apply(this,args); Admin.prototype.showAdmin=function(){ return "admin"; } } Admin.prototype= Object.create(User.prototype); let xj=new Admin("xj",18); xj.show();