代码语言:javascript复制
function user(names,age,jobs){
if(this instanceof user){
this.names=name;
this.age=age;
this.jobs=jobs;
}
else{
return new user(name,age,jobs)
}
}
admin.prototype=new user();
function admin(namek,pass){
user.call(this,'jcomey','28','design');
console.log(this);
this.namek=name;
this.pass=pass;
}
var fuck=new admin();
alert(fuck.jobs);