0Pricing
Javascript for Kids · Lesson

Math with Variables

Calculate using your magic boxes.

Math with Variables is a free Javascript for Kids lesson on CoddyKit — lesson 4 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.

Math + Boxes!

Hello, super wizard! 🧙 Today you mix math with variable boxes! 📦➕

Numbers in Boxes

Remember variables? You can put numbers in boxes and do math with them! 🔢📦

Add Two Boxes

Run this to add two number boxes! ▶️

let a = 5
let b = 3
console.log(a + b)

Why Use Boxes for Math?

Boxes let you name your numbers. 🏷️

Instead of just 5, you can call it apples. Much clearer!

Apples Plus Oranges

Run this fruit math! 🍎🍊

let apples = 4
let oranges = 6
console.log(apples + oranges)

Save the Answer

You can put a math answer into a new box! Run this. 🎁

let a = 10
let b = 5
let total = a + b
console.log(total)

Multiply Boxes

Boxes work with all math! Run this multiply. ✖️

let boxes = 3
let candyPerBox = 8
console.log(boxes * candyPerBox)

A Score Box

Add points to a score box! Run this. 🎮

let score = 100
let bonus = 50
console.log(score + bonus)

Change and Recount

Change a box, then do math again! Run this. 🔄

let coins = 10
coins = coins + 5
console.log(coins)

Total of Three

Add three boxes together! Run this. ➕

let a = 2
let b = 4
let c = 6
let sum = a + b + c
console.log(sum)

Smart Math

Math with variables is how real games count scores, coins, and lives! 🎮💰

You are coding like a pro!

Quick Check

Final quiz! 🧮

Math Wizard Complete!

WOW! 🎉🎉 You finished the Math Wizard course! You can do math with numbers and variables.

You are a true Math Wizard! 🧙⭐ Amazing job!

Frequently asked questions

Is the “Math with Variables” lesson free?

Yes — the full text of “Math with Variables” 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 “Math with Variables”?

Calculate using your magic boxes. 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 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Math with Variables” 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. Adding and Subtracting
  2. Multiplying and Dividing
  3. The Remainder Trick
  4. Math with Variables
← Back to Javascript for Kids