classPeople{// 初始化constructor(race){this.race = race
}// 这里往下所有方法实际都是写在People的原型对象上的staticinit(){
console.log('静态方法')}say(){
People.init()
console.log(`I am a ${this.race}`)}}classManextendsPeople{constructor(sex){super('human')this.sex = sex
}declare(){
console.log(`I am a ${this.sex}`)}}const boy =newMan('man')
boy.say()
boy.declare()
console.log(boy)// Man { race: 'human', sex: 'man' }