Caffeinated Coder
Book an appointment
Lesson 03 · Basics

Variables: let and const

A variable is a name for a value, like a labelled box in memory. Follow a six-line program that keeps a game score: let makes a box whose value can change, const makes a locked box, and = works out the right side first and then stores the answer on the left. The last line tries to change a const, and JavaScript stops it with a TypeError.

9 min10 steps5 questionsBeginner
Fig 3 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.