Use super to call the parent class constructor or methods.
class Animal {
constructor(name) {
this.name = name;
}
}
class Dog extends Animal {
constructor(name, breed) {
super(name); // Call parent constructor
this.breed = breed;
}
}
In subclass constructors, call super() before using this.