# Inheritance

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

## 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";
    }
}
```

Level: Journeyman · [More JavaScript terms at this level](https://www.ask-codey.com/glossary/subjects/javascript/journeyman)

Updated: September 27, 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)

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