extends
noun
say it: “ik-STENDZ” /ɪkˈstɛndz/
The keyword in a class line, as in class Fighter extends Ship, that makes the new class inherit from another one.
What is extends in JavaScript?
extends — A keyword that makes one class inherit from another.
class Alert {
text() {
return "Alert";
}
}
class EmailAlert extends Alert {
text() {
return "Email";
}
}
In a sentence
- “class ServingsError extends Error, so my error has a name, a message and a stack trace.”
Level: Journeyman · More JavaScript terms at this level
Updated