class people{
constructor(name1,gender,height,weight,skill){
this.name1 = name1;
this.gender = gender;
this.height = height;
this.weight = weight;
this.skill = skill;
}
coding(){
return `${this.name1}正在加班敲${this.skill}代码`
}
}
class newpeople extends people{
constructor(name1,gender,height,weight,skill,age){
super(name1,gender,height,weight,skill)
this.age = age
}
coding(){
return `今年${this.age}岁的${this.name1}正在加班敲${this.skill}代码`
}
}
let man = new people('张三','男','180cm','80kg','java')
let woman = new people('翠花','女','170cm','60kg','javascript')
console.log(man)
console.log(man.coding())
console.log(woman)
console.log(woman.coding())
let newWoman = new newpeople('翠花','女','170cm','60kg','javascript',19)
console.log(newWoman.coding())
console.log(man.coding())
console