class Person {
age = 100;
constructor(props) {
this.age = props.age;
}
}
class Boy extends Person {
name = 'Jack';
constructor(props) {
super(props);
this.name = props.name;
}
}
const b1 = new Boy({name : 'Mike', age : 19});
console.log(b1.name,b1.age);
网友评论