super

noun

say it: “SOO-per” /ˈsuːpər/

A keyword a child class uses to reach its parent class: super(...) runs the parent's constructor, and super.describe() runs the parent's version of a method.

What is super in JavaScript?

super — A reference used to access a superclass constructor or member.

class Alert {
    text() {
        return "Alert";
    }
}

class EmailAlert extends Alert {
    text() {
        return "Email";
    }
}

In a sentence

  • “Fighter's constructor calls super(name) first, so Ship can set up the name and shields.”

Level: Journeyman · More JavaScript terms at this level

Updated

In other subjects