Lesson 1 of 5 · 8 minutes
What is a variable?
A variable is a labelled box that holds a value.
let age = 25; makes a box named age and puts
25 inside. let means “make a new box.” The
= sign puts the value inside. This is
assignment.
The name is only a label. age is not 25. It names the box that
holds 25. console.log(age) prints the value inside.
The name labels the box. The value goes inside.
Loading the editor…
Change 25 to your age. The label stays the same; only the value changes.
Quick check
You can now make a variable, put a value in it, and read it back.