📦
Variable
(Var-i-a-ble)
What is it? 🤔
A variable is just a Labeled Box where the computer keeps information safe.
Imagine a box written "My Score" on it. You can put the number 10 inside. Later, if you win points, you can take 10 out and put 20 in!
Example: The Score Box 🏆
0
Score
Start of Game
➡️
100
Score
You Won a Coin! 🪙
💡 Fun Fact
Variables can hold more than just numbers! They can hold words (Strings), True/False (Booleans), or even whole lists of things!
🎮 Try It Yourself!
Click the buttons to change the value inside the variable box.
0
myScore
var myScore = 0;
🕵️ Secret Mission 🕵️
PASSPORT CODE:
BOX