function employee(name,age){ //JS里面无论什么类型都是function
this.name=name;
this.age=age;
}
employee.prototype={
constructor:employee,
sayName:function(){ alert(this.name) };
};
var employee1=new employee("111",19);
alert(employee1.sayName());
function employee(name,age){ //JS里面无论什么类型都是function
this.name=name;
this.age=age;
}
employee.prototype={
constructor:employee,
sayName:function(){ alert(this.name) };
};
var employee1=new employee("111",19);
alert(employee1.sayName());