0Pricing
Javascript for Kids · Lesson

Changing What Is Inside

Put new values into your boxes.

Changing What Is Inside is a free Javascript for Kids lesson on CoddyKit — lesson 3 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.

Swap the Contents!

Hello, coder! 👋 Did you know you can change what is inside a box? 📦🔄

Boxes Can Change

A variable box does not stay the same forever. You can swap what is inside! ♻️

Take out the old, put in the new.

How to Change It

To change a box, write its name, then =, then the new value.

No let this time — the box already exists!

Watch It Change

Run this! First the box holds "apple", then we change it to "banana". 🍎➡️🍌

let fruit = "apple"
console.log(fruit)
fruit = "banana"
console.log(fruit)

The Old One Is Gone

When you put something new in the box, the old thing leaves. 👋

A box holds only one thing at a time!

Change a Number

Numbers can change too. Run this score change! 🎮

let score = 10
console.log(score)
score = 50
console.log(score)

Why Change Boxes?

Changing boxes is super useful! 💡

  • A score that goes up 📈
  • A mood that changes 😊➡️😎
  • A level you reach

Level Up!

Run this to level up your hero! ⬆️

let level = 1
console.log(level)
level = 2
console.log(level)

Only let Once

Remember: use let only the first time. 1️⃣

After that, just use the name to change it!

Change It Many Times

You can change a box as many times as you want! Run this. 🌈

let color = "red"
console.log(color)
color = "blue"
console.log(color)
color = "green"
console.log(color)

Boxes Are Flexible

Because boxes can change, your code can do lots of cool things over time. 🎉

Quick Check

Change quiz! 🔄

Change Champ!

Awesome! 🎉 You learned how to change what is inside a box.

You are a change champ! 🔄🏆

Frequently asked questions

Is the “Changing What Is Inside” lesson free?

Yes — the full text of “Changing What Is Inside” 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 “Changing What Is Inside”?

Put new values into your 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 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Changing What Is Inside” 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