0Pricing
Javascript for Kids · Lesson

Winning

Reach the treasure.

Reach the Treasure! 🏆

The hero made it! Now we build the winning ending, with treasure, cheers, and confetti! 🎊 Let us celebrate victory!

Checking for the Win 🎯

The player wins when they reach the goal. Check it with if!

let location = "treasure room"
if (location === "treasure room") {
  console.log("You found the treasure! 💰")
}

All lessons in this course

  1. Planning the Adventure
  2. Making Choices
  3. Winning
  4. Game Over
← Back to Javascript for Kids