Javascript for Kids · Lesson

What Is a Variable?

A variable is a box that holds a value.

Lesson 1 of 413 steps

What Is a Variable? is a free Javascript for Kids lesson on CoddyKit. This is 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, and your progress syncs across the web and the CoddyKit app. The Javascript for Kids course includes 4 lessons in total.

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! 📦👑

Free to start

Learn JavaScript with an AI tutor — free

Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.

Courses
35
Lessons
140

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. 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. The Javascript for Kids course includes 4 lessons in total.

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, so you can start here or from the beginning and move at your own pace. This is lesson 1 of 4.

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

  1. What Is a Variable?
  2. Making and Naming Boxes
  3. Changing What Is Inside
  4. Using Your Variables
← Back to Javascript for Kids