I am reading about JavaScript class from the Mozilla documentation section of \'Class body and method definitions\'. Under the Constructor section, it states that
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()
}