← JavaScript

Variables: let, const, var

Declares a variable whose value can be changed later.

Understanding Variables: let, const, var in JavaScript

What it does: var is the original keyword, now mostly replaced by let/const. Using const shows the value is meant to stay the same. let creates a variable whose value can change. const locks the value so it can't be changed. let and const are preferred over the older 'var' keyword. Redeclaring a let variable in the same scope causes an error. const signals to other developers that the value is fixed. JavaScript is case-sensitive, so it must be lowercase 'let'.

Common mistakes: 'const' is misspelled as 'cnst'. const values cannot be reassigned after they're set.

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 1–10) 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
Can a variable declared with let be reassigned later?
YesNo
Matches
const pi = 3.14; pi = 3.15;
↓
Wrong - const variables can't be reassigned
Applying
Meanings
Term
let
Meaning
Declares a variable whose value can be changed later.
Practice
let age = 12;
Testing
Gaps
age = 12
Check Answer
Spots
1let age = 12;
2cnst name = "Sam";

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

The 'Giant Isopod' badge — Patient Builder, 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. Can a variable declared with let be reassigned later?
A. Yes ✓
B. No
let creates a variable whose value can change.
2. Can a variable declared with const be reassigned later?
A. No ✓
B. Yes
const locks the value so it can't be changed.
3. Is 'var' the modern, preferred way to declare variables?
A. Yes
B. No ✓
let and const are preferred over the older 'var' keyword.
4. Does 'let count = 5;' declare a variable named count?
A. No
B. Yes ✓
This line creates a variable called count with value 5.
5. Can you redeclare the same variable name with let twice?
A. No ✓
B. Yes
Redeclaring a let variable in the same scope causes an error.

Match the Pairs

let age = 12; → Declares a variable that can change later
const name = "Sam"; → Declares a variable that can never be reassigned
The older, less preferred way to declare variables → var total = 100;
Signals to other developers that a value is fixed → const
const pi = 3.14; pi = 3.15; → Wrong - const variables can't be reassigned
LET score = 0; → Wrong - the keyword 'let' must be lowercase

Key Term

let
Declares a variable whose value can be changed later.

Fill in the Blanks

1. let age = 12
Hint: Type the keyword used to declare a variable that can change.
2. const name = "Sam"
Hint: Type the keyword used to declare a variable that never changes.
3. let score = 0; score = score + 1
Hint: Type the operator used to add to the score.
4. var total = 100
Hint: Type the older keyword used to declare a variable.
5. const pi = 3.14
Hint: Type the keyword used to declare a variable that never changes.

Spot the Error

Question 1
A let age = 12;
B cnst name = "Sam";
C age = 13;
Line B — 'const' is misspelled as 'cnst'.
Question 2
A const pi = 3.14;
B let score = 0;
C score = score + 1;
D let count = 5;
E pi = 3.15;
Line E — const values cannot be reassigned after they're set.
Question 3
A LET total = 10;
B let count = 5;
C count = 6;
Line A — 'let' must be lowercase - a capital L causes an error.
Question 4
A var oldWay = 1;
B let modernWay = 2;
C const modernWay = 3;
Line C — You can't redeclare 'modernWay' - it's already declared with let.
Question 5
A const name = "Sam";
B let age = 12;
C age == 13;
Line C — Assignment uses a single =, not the comparison operator ==.

Student with a class code? Join your class →