← ACARA Digital Technologies Years 7–8

Comparison operators: !==, <, >, <= and >=

Comparison operators: !== checks two values are not equal, while <, >, <= and >= compare size. Each gives true or false. 50 >= 50 is true, but 50 > 50 is false.

Understanding Comparison operators: !==, <, >, <= and >= in ACARA Digital Technologies Years 7–8

What it does: > needs the left value to be strictly bigger, so two equal numbers give false. <= gives true when points is less than or equal to 100, including exactly 100. Not equal is written !== with the ! first. =! is not a comparison operator. At least 140 includes 140 itself, so use >=. Using > would wrongly reject a height of exactly 140. lives is 3, so the two values are equal. That means !== gives false. Comparison operators never return the difference. They always give a boolean, either true or false. !== means not equal to, so the result is true whenever score is different from 0.

Common mistakes: The comment says 50 or more passes, but score > 50 is false when score is exactly 50. It should be score >= 50. The not equal operator is written !== with the ! first. =! is not a valid comparison operator. It should be lives !== 0.

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 583–598) and word search (Modules 583–613).

Take this worksheet further — free with Cloodit

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

Learning
Duo
What does 50 >= 50 give?
falsetrue
Matches
if (lives =! 0) {
↓
The symbols are in the wrong order and use only one equals sign. Not equal is written !==, and =! is not a comparison.
Applying
Meanings
Term
!== < > <= >=
Meaning
Comparison operators: !== checks two values are not equal, while <, >, <= and >= compare size. Each gives true or false. 50 >= 50 is true, but 50 > 50 is false.
Practice
let score = 50;
Testing
Gaps
console.log(50 50);
Check Answer
Spots
2// 50 or more passes
3let pass = score > 50;

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

The 'Barreleye Fish' badge — Clear Vision, 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. What does 50 >= 50 give?
A. false
B. true ✓
The >= operator means greater than OR equal to. 50 is equal to 50, so the result is true.
2. What does 50 > 50 give?
A. false ✓
B. true
The > operator needs the left side to be strictly bigger. 50 is not bigger than 50, so the result is false.
3. Which expression checks that score is NOT equal to 10?
A. score !== 10 ✓
B. score =! 10
Not equal is written !== with the ! first. =! is not a comparison operator.
4. let age = 12; What does age < 13 give?
A. false
B. true ✓
12 is less than 13, so age < 13 is true.
5. A ride needs a height of at least 140. Which test is correct for the height variable?
A. height >= 140 ✓
B. height > 140
At least 140 includes 140 itself, so use >=. Using > would wrongly reject a height of exactly 140.

Match the Pairs

score !== 0 → Checks that score is not equal to 0, giving true when score is any other value
age >= 13 → True when age is 13 or more, so 13 itself counts
The boundary value is not included when you use > on its own, so 50 > 50 is false → console.log(50 > 50);
Comparing a variable with a number to check it is at most 100 → points <= 100
if (lives =! 0) { → The symbols are in the wrong order and use only one equals sign. Not equal is written !==, and =! is not a comparison.
if (mark => 50) { → => is not a comparison operator. Greater than or equal to must be written >= with the > first.

Key Term

!== < > <= >=
Comparison operators: !== checks two values are not equal, while <, >, <= and >= compare size. Each gives true or false. 50 >= 50 is true, but 50 > 50 is false.

Fill in the Blanks

1. console.log(50 >= 50);
Hint: Type the operator that checks if the left value is greater than or equal to the right value. It gives true here.
2. console.log(50 > 50);
Hint: Type the operator for strictly greater than. Equal values do not count, so the result is false.
3. let score = 42; console.log(score !== 50);
Hint: Type the operator that tests whether two values are not equal.
4. let age = 13; console.log(age < 18);
Hint: Type the operator that checks if the left value is smaller than the right value.
5. let lives = 3; console.log(lives <= 3);
Hint: Type the operator that checks if the left value is less than or equal to the right value.

Spot the Error

Question 1
A let score = 50;
B // 50 or more passes
C let pass = score > 50;
D console.log(pass);
Line C — The comment says 50 or more passes, but score > 50 is false when score is exactly 50. It should be score >= 50.
Question 2
A let lives = 3;
B let alive = lives =! 0;
C console.log(alive);
Line B — The not equal operator is written !== with the ! first. =! is not a valid comparison operator. It should be lives !== 0.
Question 3
A let temp = 35;
B if (temp => 30) {
C console.log("Hot");
D }
Line B — => is not a comparison operator. 'Greater than or equal to' is written >= with the > first. It should be temp >= 30.
Question 4
A let diff = 7 <> 8;
B console.log(diff);
C console.log(7 < 5);
Line A — JavaScript has no <> operator. Not equal is written !==. It should be 7 !== 8.
Question 5
A let age = 16;
B let msg = "Too young";
C if (age = 16) {
D msg = "Can drive";
E }
Line C — A single = assigns a value, it does not compare. To check whether age is 16 or more, use >=. It should be age >= 16.

Student with a class code? Join your class →