Assertion: inheritance's value | /r/HasProperty | dosomething
Facets:
Source sentences:
text: class AnimalES6 { constructor(name) { this.name = name; this._age = 0; } get age() { return this._age; } set age(value) { if (value < 0) { console.log("We do not support undead animals"); } this._age = value; } doSomething() { console.log("I'm a " + this.name); } } var lionES6 = new AnimalES6("Lion"); lionES6.doSomething(); lionES6.age = 5;
text: = value; } doSomething() {
text: ; } get legsCount() { return this[legsCountSymbol]; } set legsCount(value) { if (value < 0) { console.log("We do not support nether or interstellar insects"); } this[legsCountSymbol] = value; } doSomething() { super.doSomething();