Я новичок в JavaScript, и я пытаюсь достичь логики, которую я прокомментировал в методе конструктора базового класса < /p>
export default class Building {
constructor(sqft) {
this._sqft = sqft;
// when a subClass extends from this class
// and does not implement `certainMethod()`, throw an error.
// this should happen only when `subClass extends baseClass` and not with `new` keyword
// object creation.
}
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... javascript
Мобильная версия