Polymorphism

Different objects answering the same method call in their own way.

What is Polymorphism in JavaScript?

Polymorphism — Different objects answering the same method call in their own way.

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

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

Level: Journeyman · More JavaScript terms at this level

Updated

In other subjects