0Pricing
Javascript for Kids · Lesson

What Is an Object?

Group related info.

What Is an Object? 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.

Meet the Treasure Chest! 🪙

Imagine a magic treasure chest 🧰 that can hold lots of things at once! In JavaScript we call this an object.

An object groups related info together, like a chest holding gold, gems, and a map all in one place!

Why Group Stuff? 🤔

What if you wanted to remember everything about your dog 🐶? Its name, age, and color!

You could make 3 separate boxes... OR put them all in ONE chest. Objects let you keep related things together!

Building a Chest 🛠️

We build an object with curly braces { }. Inside go properties (the things we store).

Each property has a name and a value, like name: 'Rex'.

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

More Treasures Inside 💎

A chest can hold MANY treasures! Just put a comma , between each one.

Here our dog chest holds a name, an age, AND a color!

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

Names and Values 🏷️

The left side is the key (a label, like a sticker on a jar). The right side is the value (what is inside).

  • name is the key
  • 'Rex' is the value
let cat = {
  name: 'Mittens',
  age: 2
}
console.log(cat)

Different Kinds of Treasure 🌈

Values can be many things! Words (in quotes), numbers, even true or false.

Look, our robot chest 🤖 holds all three kinds!

let robot = {
  name: 'Beep',
  batteries: 4,
  isFriendly: true
}
console.log(robot)

An Empty Chest 📭

You can even make an empty chest with nothing inside yet: just { }.

It is ready and waiting for you to add treasures later!

let chest = {}
console.log(chest)
console.log('Empty and ready!')

A Toy Box Object 🧸

Let us make a chest for a favorite toy! It can have a name, a price, and whether it is fun.

Run it and see your toy box appear!

let toy = {
  name: 'Bouncy Ball',
  price: 3,
  isFun: true
}
console.log(toy)

Objects Hold Words Too 📝

Objects are great for describing a person too! Let us make a chest for a superhero 🦸.

Name, power, and how many friends they have!

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

Why Objects Rock 🎸

Objects keep your code tidy! Instead of many loose boxes scattered around, everything lives in one neat chest.

  • Easy to find
  • Easy to share
  • Easy to understand

Make Your Own! 🌟

Try making a chest for YOUR favorite snack 🍪! Give it a name and a number.

Here is one to get you started. Change the words and run it!

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

Quick Check ✅

Time for a brain teaser! 🧠 Let us see what you remember about treasure chests (objects).

Treasure Chest Recap 🎉

Awesome work, explorer! 🗺️ You learned that an object is a treasure chest that groups related info.

  • Use curly braces { }
  • Each treasure is a key: value pair
  • Separate them with commas

Next we will learn how to READ the treasures inside! 💎

Frequently asked questions

Is the “What Is an Object?” lesson free?

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

Group related info. 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 an Object?” 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