break and continue

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

break and continue

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Does break exit a loop completely?
A No
B Yes
2. Does continue skip the rest of the current pass only?
A Yes
B No
3. Is 'stop' a valid keyword to exit a loop?
A No
B Yes
4. Must 'break' be written in lowercase?
A No
B Yes
5. Does continue stop the loop from running any more passes?
A No
B Yes

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1break; AWrong - use 'break', not 'stop', to exit a loop
2continue; BExits the loop completely
3Stops a loop early once a condition is met Cif (x % 2 === 0) { continue; }
4Skips even numbers while looping DSkips the rest of this pass and moves to the next
5if (i === 4) { stop; } EWrong - use 'continue', not 'skip', to move to the next pass
6if (i === 2) { skip; } Fif (found) { break; }

Definitions

break

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
if (i === 4) { _____; }
2.
if (i === 2) { ________; }
3.
if (n > 10) { _____; }
4.
if (x % 2 === 0) { ________; }
5.
if (found) { _____; }

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A if (i === 4) {
B stop;
C }
Question 2
A if (i === 2) {
B skip;
C }
Question 3
A Break;
B for (let i = 0; i < 5; i++) {
C if (i === 3) {
D }
Question 4
A for (let j = 0; j < 5; j++) {
B if (j === 1) {
C }
D Continue;
Question 5
A for (let k = 0; k < 5; k++) {
B if (k > 3) {
C console.log(k);
D }
E brek;

Answer Key

break and continue
Section A: Quick Questions
Q1
B — Yes
Q2
A — Yes
Q3
A — No
Q4
B — Yes
Q5
A — No
Section B: Match the Pairs
Q1
break; → Exits the loop completely
Q2
continue; → Skips the rest of this pass and moves to the next
Q3
Stops a loop early once a condition is met → if (found) { break; }
Q4
Skips even numbers while looping → if (x % 2 === 0) { continue; }
Q5
if (i === 4) { stop; } → Wrong - use 'break', not 'stop', to exit a loop
Q6
if (i === 2) { skip; } → Wrong - use 'continue', not 'skip', to move to the next pass
Section C: Definitions
Q1
break — Exits a loop completely, stopping it before it finishes all its passes.
Section D: Fill in the Blanks
Q1
if (i === 4) { break; }
Q2
if (i === 2) { continue; }
Q3
if (n > 10) { break; }
Q4
if (x % 2 === 0) { continue; }
Q5
if (found) { break; }
Section E: Spot the Error
Q1
B — 'break' is the keyword to exit a loop, not 'stop'.
Q2
B — 'continue' is the keyword to skip a pass, not 'skip'.
Q3
A — 'break' must be lowercase - a capital B causes an error.
Q4
D — 'continue' must be lowercase - a capital C causes an error.
Q5
E — 'break' is misspelled as 'brek'.