let Moves = {
move() {
console.log(`${this.name} move to home`)
}
}
class Sounds {
say() {
console.log(`what the ${this.name} say`)
console.log(this)
}
}
class Animal {
constructor(name) {
this.name = name
}
}
Object.assign(Animal.prototype, new Sounds(), Moves)
const animal = new Animal('fox')
animal.say()