I am trying to explore JS class and here I am getting error, if I am not calling super().
ReferenceError: Must call super constructor in derived class before accessing ‘this’ or returning from derived constructor
class Employee {
constructor(){
console.log("I am an employee")
}
}
class Learner extends Employee {
constructor(){
console.log("I am a learner")
}
}
var learner = new Learner();
But my requirement is that I just want to call constructor of child class. Can I do something about it?
1