Skip to content
LearnLoop
← Software Engineering

Variables: labelled boxes

See it

A variable is a labelled box

  • A variable has a name (the label) and a value (what's inside).
  • let lives = 3; makes a box called lives holding 3.
  • You can swap what's inside later: lives = 2;.
Name
lives
Box
holds a value
Value
3