0Pricing
Javascript for Kids · Lesson

A List of Animals

Store animal clues.

A List of Animals 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.

Welcome, Animal Detective! 🕵️

Get ready to build a super fun Guess the Animal game! 🐶🐱🦁

The computer will think of an animal, give you clues, and YOU try to guess it. But first... we need a place to keep all our animals!

What is a List? 📝

A list (we call it an array) is like a toy box that holds lots of things. 🧸

We use square brackets [ ] and put commas between each thing.

let animals = ["dog", "cat", "lion"]
console.log("My animal box has:", animals)

Adding More Animals 🦒

The more animals, the more fun the game! Let us pack the box with lots of friends.

let animals = ["dog", "cat", "lion", "giraffe", "penguin"]
console.log("Total animals:", animals.length)

Counting Animals 🔢

Every list knows how big it is! Use .length to count what is inside. 🪄

let animals = ["dog", "cat", "lion"]
console.log("I have " + animals.length + " animals!")

Peeking at One Animal 👀

Each spot in the list has a number called an index. The first one is 0, not 1! 🤓

let animals = ["dog", "cat", "lion"]
console.log("First animal:", animals[0])
console.log("Second animal:", animals[1])

The Secret Animal 🤫

For our game, the computer picks ONE secret animal from the box. Let us grab the lion!

let animals = ["dog", "cat", "lion"]
let secret = animals[2]
console.log("Shhh... the secret is a", secret)

Animals with Clues 💡

Each animal needs clues! We can store an animal and its clues together using an object with curly braces { }.

let animal = { name: "lion", clue: "I am the king of the jungle!" }
console.log(animal.clue)

A List of Clue Objects 📦

Now we make a list of objects. Each one is an animal AND its clue. So cool! 😎

let animals = [
  { name: "dog", clue: "I love to bark and fetch!" },
  { name: "cat", clue: "I say meow and chase mice!" }
]
console.log(animals[0].clue)

Reading the Name and Clue 🏷️

From one animal object we can read both the name and the clue. 🎉

let animal = { name: "frog", clue: "I am green and I hop!" }
console.log("Animal:", animal.name)
console.log("Clue:", animal.clue)

Looping Through the Box 🔁

We can visit every animal one by one with a loop. Like checking each toy in the box!

let animals = ["dog", "cat", "lion"]
for (let i = 0; i < animals.length; i++) {
  console.log("Animal number " + i + ":", animals[i])
}

Our Game Data is Ready! ✅

Awesome work! We built a list of animals, each with a clue. This is the heart of our game. ❤️

Next, we will start giving those clues to the player!

let animals = [
  { name: "lion", clue: "I am the king of the jungle!" },
  { name: "frog", clue: "I am green and I hop!" }
]
console.log("Game ready with " + animals.length + " animals! 🎮")

Quick Check ❓

Time for a brain teaser! 🧠

You Did It! 🌟

Recap time! Today you learned to:

  • 📝 Make a list with [ ]
  • 🔢 Count items with .length
  • 📦 Store animals and clues in objects
  • 🔁 Visit every animal with a loop

Your animal box is packed and ready. Onward to giving clues! 🚀

Frequently asked questions

Is the “A List of Animals” lesson free?

Yes — the full text of “A List of Animals” 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 “A List of Animals”?

Store animal clues. 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 “A List of Animals” 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. A List of Animals
  2. Giving Clues
  3. Checking Guesses
  4. You Got It!
← Back to Javascript for Kids