waterResist: 5,
sound: 'Meow',
canFly() {
canSwim = () => {
console.log(this.sound)
return canSwim();
}
}
};
console.log('canFly:', canFly()) // undefined
ты всё в кучу понамешал. const animal = { weight: '100k', waterResist: 5, sound: 'Meow', getSound() { return this.sound; } }; console.log('getSound:', animal.getSound())
Обсуждают сегодня