learn.javascript
by Vladymyr Shevchuk
JavaScript
class Notification {
constructor (width, height) {
this.width = width;
this.height = height;
}
show () {
console.log('normal button');
}
}
class WarningNotification extends Notification {
constructor (width, height, color) {
// super(width, height);
this.color = color;
}
show () {
console.log('warning button', this.width, this.height, this.color);
}
}
const warningNotofication = new WarningNotification(20, 40, 'red');
warningNotofication.show();