# Inheritance

*noun*

say it: **“in-HAIR-ih-tunss”** **/ɪnˈhɛrɪtəns/**

A way for one class to start with everything another class has, then add to it or change parts of it.

## What is **Inheritance** in JavaScript?

**Inheritance** — A new class starts with everything from another class, then adds or changes things.

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

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

## In a sentence

- “Through **inheritance**, Fighter gets Ship's shields and fly method without copying them.”

Level: Journeyman · [More JavaScript terms at this level](https://www.ask-codey.com/glossary?category=javascript&level=3)

Updated: November 9, 2026

## In other subjects

- [Inheritance in C#](https://www.ask-codey.com/glossary/inheritance-c-sharp)
- [Inheritance in CSS](https://www.ask-codey.com/glossary/inheritance-css)
- [Inheritance in Java](https://www.ask-codey.com/glossary/inheritance-java)
- [Inheritance in OOP](https://www.ask-codey.com/glossary/inheritance-oop)
- [Inheritance in Python](https://www.ask-codey.com/glossary/inheritance)

Source: https://www.ask-codey.com/glossary/inheritance-javascript
