← ACARA Digital Technologies Years 7–8

The number data type

A value written without quotes, whole (7), decimal (3.5) or negative (-2), that you can calculate with. 5 is a number but '5' in quotes is a string, which is text.

Understanding The number data type in ACARA Digital Technologies Years 7–8

What it does: 7 and 3 are numbers, so + adds them and gives 10. The quotes turn 5 into text, so this variable holds a string and not a number. Numbers can be calculated with, so 5 + 5 is 10. Joining two strings, like "5" + "5", gives "55". A whole number has no decimal point. 4.2 is a decimal number. Negative values like -2 are numbers too, as long as they are written without quotes.

Common mistakes: The letter x is not a multiplication operator in JavaScript. Numbers are multiplied with *, so the line should be let total = price * qty;. typeof is one word. Writing 'type of' with a space is a syntax error. It should be console.log(typeof total); which prints number.

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 562–580) and word search (Modules 522–580).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Which one is a number in JavaScript?
let age = 13;let age = "13";
Matches
let age = "13"; console.log(age + 2);
↓
The quotes make "13" a string, so age + 2 joins the text and prints 132 instead of adding to give 15. Remove the quotes: let age = 13;
Applying
Meanings
Term
number
Meaning
A value written without quotes, whole (7), decimal (3.5) or negative (-2), that you can calculate with. 5 is a number but '5' in quotes is a string, which is text.
Practice
let age = 13;
Testing
Gaps
console.log(lives 2);
Check Answer
Spots
2let qty = 4;
3let total = price x qty;

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

The 'Reindeer' badge — Dictionary Guide, 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. Which one is a number in JavaScript?
A. let age = "13";
B. let age = 13; ✓
A number is written without quotes. Quotes around 13 turn it into a string, which is text.
2. Which value is a decimal number?
A. 3.5 ✓
B. "3.5"
3.5 is a decimal number. With quotes it becomes a string, so it is only text.
3. Which one is a negative number?
A. let temp = -2; ✓
B. let temp = "-2";
A negative number has a minus sign and no quotes. "-2" in quotes is a string.
4. What does 5 + 5 give?
A. 10 ✓
B. 55
Numbers can be calculated with, so 5 + 5 is 10. Joining two strings, like "5" + "5", gives "55".
5. Which statement is true?
A. 5 and "5" are both numbers
B. 5 is a number and "5" is a string ✓
Quotes make the difference. 5 is a number, but "5" is a string, which is text.

Match the Pairs

let score = 3.5; → Stores a decimal number. It has no quotes, so JavaScript treats it as a number you can calculate with.
let temp = -2; → Stores a negative number. The minus sign is part of the number, and it still has no quotes.
A whole number with no quotes is a number, so you can calculate with it → let total = 7 + 3;
A value in quotes is a string, not a number, even if it looks like a number → let answer = "5";
let age = "13"; console.log(age + 2); → The quotes make "13" a string, so age + 2 joins the text and prints 132 instead of adding to give 15. Remove the quotes: let age = 13;
let price = 3,50; → A decimal number uses a full stop, not a comma. Write let price = 3.50; so it is one number.

Key Term

number
A value written without quotes, whole (7), decimal (3.5) or negative (-2), that you can calculate with. 5 is a number but '5' in quotes is a string, which is text.

Fill in the Blanks

1. let lives = 3; console.log(lives + 2);
Hint: Type the arithmetic operator that adds two numbers, because numbers can be calculated with.
2. // negative number: minus two let change = -2;
Hint: Type the negative number described in the comment, with no quotes.
3. // decimal number: three and a half let price = 3.5;
Hint: Type the decimal number described in the comment, with no quotes.
4. let a = 5; let b = "5"; console.log(typeof a); // number
Hint: Type the name of the variable that holds the number, not the text in quotes.
5. let n = 7; console.log(typeof n); // number
Hint: Type the data type name that typeof reports for a whole number.

Spot the Error

Question 1
A let price = 3.5;
B let qty = 4;
C let total = price x qty;
D console.log(total);
Line C — The letter x is not a multiplication operator in JavaScript. Numbers are multiplied with *, so the line should be let total = price * qty;
Question 2
A let score = 7;
B let bonus = 3;
C let total = score + bonus;
D console.log(type of total);
Line D — typeof is one word. Writing 'type of' with a space is a syntax error. It should be console.log(typeof total); which prints number.
Question 3
A let a = 1.5;
B let b = 2.5;
C let c = 3,5;
D console.log(a + b + c);
Line C — Decimal numbers use a full stop (decimal point), not a comma. A comma here is a syntax error. It should be let c = 3.5;
Question 4
A let n = "5";
B let total = n + 2;
C console.log(total);
Line A — Quotes make "5" a string, which is text. Then n + 2 joins the text and prints 52 instead of adding to make 7. It should be let n = 5;
Question 5
A let big = 1,000;
B let half = big / 2;
C console.log(half);
Line A — Numbers are written without commas. The comma causes a syntax error. It should be let big = 1000;

Student with a class code? Join your class →