JavaScript Class extends
JavaScript Class extends
Whenever we want to create a child class of another class i.e, parent, we use the extends keyword. The child class will inherit all of its properties and methods from its parent class. It is beneficial for code reusability. By using the super() method, we can access the constructor method as well as the properties and methods of the parent class.
Syntax:-
Its syntax is:- class childClass extends parentClass