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 code let age equals 25 connected to a box labelled age containing 25

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

In let age = 25, what is age?

Choose one answer.

What does the = sign do here?

Choose one answer.

You can now make a variable, put a value in it, and read it back.