0Pricing
Javascript for Kids · Lesson

Changing Properties

Update an object.

Changing Properties 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.

Swapping Treasures 🔄

What if your dog has a birthday 🎂? Its age should change!

Good news: we can change a treasure inside an object any time we want.

Use the Dot and Equals 🟰

To change a treasure, use the dot to point at it, then = to give it a new value.

Like saying: dog DOT age, you are now 5!

let dog = { name: 'Rex', age: 4 }
dog.age = 5
console.log(dog.age)

Before and After 👀

Let us watch the change happen! First we read the old value, then change it, then read again.

let dog = { age: 4 }
console.log(dog.age)
dog.age = 5
console.log(dog.age)

Change Words Too 📝

You can change word treasures as well! Maybe the cat got a new name. 🐱

let cat = { name: 'Mittens' }
cat.name = 'Shadow'
console.log(cat.name)

Grow a Number 🌱

Want to add to a number? Read it, add, and store it back!

Here the dog gets one year older. 🎉

let dog = { age: 4 }
dog.age = dog.age + 1
console.log(dog.age)

Add a NEW Treasure ✨

You can even add a treasure that was not there before! Just give a new key a value.

Let us add a color to our dog.

let dog = { name: 'Rex' }
dog.color = 'brown'
console.log(dog.color)

Flip True and False 🚦

The robot was sleeping. Let us wake it up by changing true/false! 🤖

let robot = { awake: false }
robot.awake = true
console.log(robot.awake)

Power Up the Hero 💪

Our hero learned a new power! Let us change it.

let hero = { name: 'Captain Star', power: 'flying' }
hero.power = 'super strength'
console.log(hero.power)

Eat a Cookie 🍪

Each time we eat a cookie, the amount goes DOWN by one. Let us take a bite!

let snack = { name: 'Cookies', amount: 12 }
snack.amount = snack.amount - 1
console.log(snack.amount)

Change Many at Once 🎁

You can change as many treasures as you like, one line at a time!

let pet = { name: 'Bubbles', age: 1 }
pet.name = 'Splash'
pet.age = 2
console.log(pet.name)
console.log(pet.age)

Your Turn to Change 🌟

This balloon is small. Change its size to 'big' and run it! 🎈

let balloon = { size: 'small' }
balloon.size = 'big'
console.log(balloon.size)

Quick Check ✅

Show off your changing skills! 🧠

Changing Recap 🎉

Super work! 🛠️ You learned to CHANGE treasures.

  • Point with the dot, set with =
  • Add new treasures the same way
  • Grow or shrink numbers like x = x + 1

Next: we build a whole PET object together! 🐾

Frequently asked questions

Is the “Changing Properties” lesson free?

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

Update an object. 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 Properties” 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 an Object?
  2. Reading Properties
  3. Changing Properties
  4. A Pet Object
← Back to Javascript for Kids