@niagr Да, это путь ES5.
вет, амигос. У меня есть эта маленькая структура наследования классов
class Point {
constructor(x, y) {
this.x = x;
this.y = y;
}
toString() {
return '(' + this.x + ', ' + this.y + ')';
}
}
class ColorPoint extends Point {
constructor(x, y, color) {
super(x, y);
this.color = color;
}
toString() {
return super.toString() + ' in ' + this.color;
}
}
let newObj = new ColorPoint(25, 8, 'green');
Компилируется вэто jsfiddle
Я понимаю, как это работает в ES6 глупо. Но может кто-нибудь объяснить, как это работает под капотом в ES5. В более простой форме.