← JavaScript

OOP – Inheritance (extends)

Lets a class inherit properties and methods from another class.

Understanding OOP – Inheritance (extends) in JavaScript

What it does: extends is exactly the keyword used to set up inheritance. super() runs the parent's setup logic from within the subclass. extends creates a subclass that gains the parent's properties and methods. JavaScript is case-sensitive, so it must be lowercase 'extends'. The correct keyword is 'extends', not 'extend'. A subclass can define new methods in addition to inherited ones. super() sets up the inherited part of the object before it's used. Lets a class inherit properties and methods from another class.

Common mistakes: 'class' must be lowercase - a capital C causes an error. 'class' is misspelled as 'clas'.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 41–52) and word search (Modules 21–52).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Does extends let a class inherit from another class?
YesNo
Matches
class Dog Extends Animal { ... }
↓
Wrong - 'extends' must be lowercase
Applying
Meanings
Term
extends
Meaning
Lets a class inherit properties and methods from another class.
Practice
class Animal {
Testing
Gaps
class Dog Animal {
Check Answer
Spots
1Class Ant extends Animal {
2constructor(name) {

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Chambered Nautilus' badge — File Explorer, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Does extends let a class inherit from another class?
A. Yes ✓
B. No
extends creates a subclass that gains the parent's properties and methods.
2. Does super() call the parent class's constructor?
A. Yes ✓
B. No
super() runs the parent's constructor logic inside the child.
3. Is 'Extends' with a capital E valid JavaScript syntax?
A. No ✓
B. Yes
JavaScript is case-sensitive, so it must be lowercase 'extends'.
4. Must 'super' be written in lowercase?
A. No
B. Yes ✓
JavaScript is case-sensitive, so 'super' must be lowercase.
5. Is 'extend' (without an s) the correct keyword?
A. Yes
B. No ✓
The correct keyword is 'extends', not 'extend'.

Match the Pairs

class Dog extends Animal { ... } → Declares Dog as a subclass that inherits from Animal
super(name); → Calls the parent class's constructor with name
Lets one class inherit properties and methods from another → extends
Calls the parent class's constructor inside a child class → super()
class Dog Extends Animal { ... } → Wrong - 'extends' must be lowercase
Super(name); → Wrong - 'super' must be lowercase

Key Term

extends
Lets a class inherit properties and methods from another class.

Fill in the Blanks

1. class Dog extends Animal {
Hint: Type the keyword that lets Dog inherit from Animal.
2. super(name);
Hint: Type the keyword that calls the parent class's constructor.
3. class Cat extends Animal {
Hint: Type the keyword that lets Cat inherit from Animal.
4. constructor(name) { super(name); }
Hint: Type the keyword that calls the parent class's constructor.
5. class Puppy extends Dog {
Hint: Type the keyword that lets Puppy inherit from Dog.

Spot the Error

Question 1
A Class Ant extends Animal {
B constructor(name) {
C super(name);
D }
E }
Line A — 'class' must be lowercase - a capital C causes an error.
Question 2
A clas Bee extends Animal {
B constructor(name) {
C super(name);
D }
E }
Line A — 'class' is misspelled as 'clas'.
Question 3
A let name = "Rex";
B class Fox Extends Animal {
C constructor(name) {
D super(name);
E }
F }
Line B — 'extends' must be lowercase - a capital E causes an error.
Question 4
A let name2 = "Tom";
B class Owl extend Animal {
C constructor(name) {
D super(name);
E }
F }
Line B — 'extends' is misspelled as 'extend'.
Question 5
A class Bear extends Animal {
B constructor(name) {
C Super(name);
D }
E }
Line C — 'super' must be lowercase - a capital S causes an error.

Student with a class code? Join your class →