In JavaScript, is constructor mandatory in a class?
You should just write a class without a constructor and see if it works :)
From the same docs
As stated, if you do not specify a constructor method a default constructor is used. For base classes the default constructor is:
constructor() {}
For derived classes, the default constructor is:
constructor(...args) {
super(...args);
}
No, It is not necessary. By default constructor is defined as :
constructor() {}
For inheritance we use this constructor to call super class as :
constructor() {
super.call()
}