JavaScript
- 39 ответов
- 0 вопросов
22
Вклад в тег
class Marine {
constructor(_damage, _armor) {
this.damage_g = _damage;
this.armor_g = _armor;
}
get damage() { return this.damage_g; }
set damage(value) { this.damage_g = value; }
get armor() { return this.armor_g; }
set armor(value) { this.armor_g = value; }
}
let marine = new Marine(10, 5);
alert(marine.damage_g)
marine.damage_g = 20;
alert(marine.damage_g)