← JavaScript

else Statements

Runs a block of code when every earlier if or else if condition was false.

Understanding else Statements in JavaScript

What it does: else is exactly what catches every remaining case. Unlike if and else if, else never takes a condition. else acts as the fallback when nothing else matched. JavaScript is case-sensitive, so 'else' must be lowercase. else must always be the last part of an if/else if/else chain. Like if, else wraps its code in { }. There can only be one final else at the end of a chain. The correct spelling is 'else', not 'els'.

Common mistakes: 'else' must be lowercase - a capital E causes an error. else never takes a condition in parentheses.

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 11–25) and word search (Modules 1–29).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Does else run when every earlier condition was false?
YesNo
Matches
} Else { console.log("Fail"); }
↓
Wrong - 'else' must be lowercase
Applying
Meanings
Term
else
Meaning
Runs a block of code when every earlier if or else if condition was false.
Practice
let score = 40;
Testing
Gaps
} {
Check Answer
Spots
1if (score >= 70) {
2} Else {

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

The 'Pufferfish' badge — Error Handler, 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 else run when every earlier condition was false?
A. No
B. Yes ✓
else acts as the fallback when nothing else matched.
2. Does else have its own condition in parentheses?
A. No ✓
B. Yes
else never takes a condition - it just catches everything else.
3. Must 'else' be written in lowercase?
A. Yes ✓
B. No
JavaScript is case-sensitive, so 'else' must be lowercase.
4. Can else come before an if statement in a chain?
A. No ✓
B. Yes
else must always be the last part of an if/else if/else chain.
5. Does else's code block use curly braces?
A. No
B. Yes ✓
Like if, else wraps its code in { }.

Match the Pairs

} else { ... } → Runs when every earlier condition in the chain was false
if (score >= 70) { ... } else { ... } → Runs the else block only if score < 70
Acts as the final fallback in a conditional chain → else
Has no condition of its own → } else {
} Else { console.log("Fail"); } → Wrong - 'else' must be lowercase
} else (age < 18) { ... } → Wrong - else never takes a condition in parentheses

Key Term

else
Runs a block of code when every earlier if or else if condition was false.

Fill in the Blanks

1. } else {
Hint: Type the keyword used as the final fallback branch.
2. if (age >= 18) { } else { console.log("Minor"); }
Hint: Type the keyword used as the final fallback branch.
3. if (n === 1) { } else { console.log("other"); }
Hint: Type the keyword used as the final fallback branch.
4. if (temp > 30) { } else { console.log("Cool"); }
Hint: Type the keyword used as the final fallback branch.
5. if (isOpen) { } else { console.log("Closed"); }
Hint: Type the keyword used as the final fallback branch.

Spot the Error

Question 1
A if (score >= 70) {
B } Else {
C console.log("Fail");
D }
Line B — 'else' must be lowercase - a capital E causes an error.
Question 2
A if (age >= 18) {
B } else (age < 18) {
C console.log("Minor");
D }
Line B — else never takes a condition in parentheses.
Question 3
A if (n === 1) {
B } els {
C console.log("one");
D console.log("other");
E }
Line B — 'else' is misspelled as 'els'.
Question 4
A if (temp > 30) {
B console.log("Hot");
C } else [
D console.log("Cool");
E ]
Line C — Code blocks use curly braces {}, not square brackets [].
Question 5
A if (isOpen) {
B console.log("Open");
C } else {
D console.log("Closed")
E }
Line D — This line is missing a semicolon, but that's not required in JS.

Student with a class code? Join your class →