← JavaScript

break and continue

Exits a loop completely, stopping it before it finishes all its passes.

Understanding break and continue in JavaScript

What it does: This exits the loop as soon as found becomes true. This skips the rest of the pass whenever x is even. break stops the loop entirely, skipping any remaining passes. continue moves straight to the next pass without stopping the loop. The correct keyword to exit a loop is 'break'. JavaScript is case-sensitive, so 'break' must be lowercase. They're typically triggered by a condition inside the loop. 'stop' isn't a valid JavaScript keyword; use 'break' instead.

Common mistakes: 'break' is the keyword to exit a loop, not 'stop'. 'continue' is the keyword to skip a pass, not 'skip'.

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 crossword (Modules 21–30) and word search (Modules 1–29) 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 break exit a loop completely?
YesNo
Matches
if (i === 4) { stop; }
↓
Wrong - use 'break', not 'stop', to exit a loop
Applying
Meanings
Term
break
Meaning
Exits a loop completely, stopping it before it finishes all its passes.
Practice
for (let i = 1; i <= 5; i++) {
Testing
Gaps
;
Check Answer
Spots
1if (i === 4) {
2stop;

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

The 'Kangaroo Rat' badge — Speed Typer, 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 break exit a loop completely?
A. No
B. Yes ✓
break stops the loop entirely, skipping any remaining passes.
2. Does continue skip the rest of the current pass only?
A. Yes ✓
B. No
continue moves straight to the next pass without stopping the loop.
3. Is 'stop' a valid keyword to exit a loop?
A. No ✓
B. Yes
The correct keyword to exit a loop is 'break'.
4. Must 'break' be written in lowercase?
A. No
B. Yes ✓
JavaScript is case-sensitive, so 'break' must be lowercase.
5. Does continue stop the loop from running any more passes?
A. No ✓
B. Yes
continue only skips the current pass - the loop keeps going.

Match the Pairs

break; → Exits the loop completely
continue; → Skips the rest of this pass and moves to the next
Stops a loop early once a condition is met → if (found) { break; }
Skips even numbers while looping → if (x % 2 === 0) { continue; }
if (i === 4) { stop; } → Wrong - use 'break', not 'stop', to exit a loop
if (i === 2) { skip; } → Wrong - use 'continue', not 'skip', to move to the next pass

Key Term

break
Exits a loop completely, stopping it before it finishes all its passes.

Fill in the Blanks

1. if (i === 4) { break; }
Hint: Type the keyword that exits the loop completely.
2. if (i === 2) { continue; }
Hint: Type the keyword that skips to the next pass of the loop.
3. if (n > 10) { break; }
Hint: Type the keyword that exits the loop completely.
4. if (x % 2 === 0) { continue; }
Hint: Type the keyword that skips to the next pass of the loop.
5. if (found) { break; }
Hint: Type the keyword that exits the loop completely.

Spot the Error

Question 1
A if (i === 4) {
B stop;
C }
Line B — 'break' is the keyword to exit a loop, not 'stop'.
Question 2
A if (i === 2) {
B skip;
C }
Line B — 'continue' is the keyword to skip a pass, not 'skip'.
Question 3
A Break;
B for (let i = 0; i < 5; i++) {
C if (i === 3) {
D }
Line A — 'break' must be lowercase - a capital B causes an error.
Question 4
A for (let j = 0; j < 5; j++) {
B if (j === 1) {
C }
D Continue;
Line D — 'continue' must be lowercase - a capital C causes an error.
Question 5
A for (let k = 0; k < 5; k++) {
B if (k > 3) {
C console.log(k);
D }
E brek;
Line E — 'break' is misspelled as 'brek'.

Student with a class code? Join your class →