Answer the question
In order to leave comments, you need to log in
Why is the class method not visible?
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
Answer the question
In order to leave comments, you need to log in
You have runEngine both a function (method) and a boolean property
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question