What's a Variable? π¦
A variable is a labeled box that holds a value so you can use it later.
We make a box with the word let, give it a name, and put something inside with
=:
let score = 10; // a box named "score" holding 10
let name = "Sam"; // a box named "name" holding "Sam"
Later, whenever you write score, the computer swaps in what's inside the box β
10.
You'll use boxes constantly: a score, a number of lives, a player's nameβ¦ all of them live in variables. π¦