What Is a Variable?
A variable is a box that holds a value.
What Is a Variable? is a free Javascript for Kids lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Javascript for Kids learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Magic Boxes!
Hello, coder! 👋 Today you meet variables — magic boxes that hold things! 📦
A Box With a Label
A variable is like a labeled box. 🏷️
You write a name on the box, then put something inside!
What Can Go Inside?
You can put words, numbers, or other things inside a variable box! 🎁
- A name like "Mia"
- A number like 10
- A favorite color
Why Boxes Help
Boxes help you remember things. 🧠
The computer can keep something safe in the box and use it later!
The Word "let"
To make a box, we use the magic word let. ✨
Like: let toy = "teddy bear"
See a Box in Action
This makes a box called pet and prints what is inside. Run it! 🐶
let pet = "puppy"
console.log(pet)No Quotes for the Box Name
When you print the box, you use its name without quotes. 📦
The computer opens the box and shows what is inside!
A Number Box
Boxes can hold numbers too! Run this. 🔢
let age = 8
console.log(age)Boxes Have Names
Every box needs a name so you can find it. 🏷️
Just like your lunchbox has your name on it!
Two Boxes
You can make many boxes! Run this. 🎁🎁
let fruit = "apple"
let count = 3
console.log(fruit)
console.log(count)Boxes Are Super Useful
Variables help your code remember and reuse things. 💡
They are one of the most important tools in coding!
Quick Check
Box quiz! 📦
Box Boss!
Awesome! 🎉 You learned that a variable is a magic labeled box that holds things.
You are a box boss now! 📦👑
Frequently asked questions
Is the “What Is a Variable?” lesson free?
Yes — the full text of “What Is a Variable?” is free to read here on the web, and the Javascript for Kids course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Javascript for Kids course, upgrade to CoddyKit PRO.
What will I learn in “What Is a Variable?”?
A variable is a box that holds a value. You practise Javascript for Kids with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Javascript for Kids?
No prior experience is required. Javascript for Kids on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “What Is a Variable?” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Javascript for Kids lesson?
Yes. Every Javascript for Kids lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- What Is a Variable?
- Making and Naming Boxes
- Changing What Is Inside
- Using Your Variables