0Pricing
Javascript for Kids · Lesson

Giving Clues

Reveal hints.

Giving Clues is a free Javascript for Kids lesson on CoddyKit — lesson 2 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.

Time to Drop Clues! 💡

Our game has animals waiting. Now we make the computer reveal hints so the player can guess! 🕵️

A Clue Lives in the Object 📦

Remember each animal has a clue. Let us read it out loud!

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

Show the Clue, Hide the Name 🙈

The trick of the game: show the clue but KEEP the name secret! 🤫

let animal = { name: "owl", clue: "I am wise and say hoot at night!" }
console.log("Here is your clue:")
console.log(animal.clue)

More Than One Clue 💡💡

Hard animals need MORE clues! We can store a list of clues inside the object.

let animal = {
  name: "elephant",
  clues: ["I am very big.", "I have a long trunk.", "I never forget!"]
}
console.log(animal.clues[0])

Giving Clues One by One 🔁

Let us reveal each clue slowly using a loop, like a real game show host! 🎤

let clues = ["I am big.", "I have a trunk.", "I never forget!"]
for (let i = 0; i < clues.length; i++) {
  console.log("Clue " + (i + 1) + ": " + clues[i])
}

Counting Down Clues ⏳

Tell the player how many clues are left. That builds the excitement!

let clues = ["I am big.", "I have a trunk.", "I never forget!"]
console.log("You get " + clues.length + " clues. Good luck!")

A Function to Give Clues 🛠️

A function is a magic helper we can use again and again. Let us make one that gives a clue!

function giveClue(animal) {
  console.log("Clue: " + animal.clue)
}
giveClue({ name: "cat", clue: "I say meow!" })

Pick a Random Animal 🎲

Real games surprise you! Use Math.random() to pick a random animal from the box.

let animals = ["dog", "cat", "lion"]
let pick = Math.floor(Math.random() * animals.length)
console.log("Mystery animal index:", pick)

Reveal Its Clue 🎁

Now combine random picking with giving a clue. So mysterious! 🔮

let animals = [
  { name: "dog", clue: "I love to fetch!" },
  { name: "cat", clue: "I say meow!" }
]
let pick = Math.floor(Math.random() * animals.length)
console.log("Clue:", animals[pick].clue)

Encourage the Player 🎉

A good host cheers the player on! Add fun messages between clues.

console.log("Here comes a clue... 🥁")
console.log("I am green and I hop!")
console.log("Can you guess? 🤔")

Clues Are Working! ✅

You can now reveal hints, count them, and even pick a random mystery animal. The player is hooked! 🎣

let clues = ["I am tall.", "I have a long neck."]
clues.forEach(function(c, i) {
  console.log("Hint " + (i + 1) + ": " + c)
})

Quick Check ❓

Show off what you learned! 🧠

Clue Master! 🏅

Recap! You can now:

  • 💡 Show a clue from an object
  • 🔁 Reveal many clues with a loop
  • 🎲 Pick a random animal
  • 🛠️ Use a function as a helper

Next: we check if the player guessed right! 🤞

Frequently asked questions

Is the “Giving Clues” lesson free?

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

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

How long does the “Giving Clues” 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