class Auto {
constructor(runEngine) {
this.runEngine = runEngine
}
runEngine() {
this.runEngine = true
}
}
class Bentley extends Auto {
constructor(model) {
super(false)
this.model = model
}
runEngine() {
super.runEngine()
console.log('Система бентли говорит: Двигатель успешно запущен!')
}
}
const car = new Bentley('Bentley Continental GT V8')
car.runEngine() // is not a function