Starting at Zero
Set up a score.
Starting at Zero 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.
Build a Score Keeper! 📊
Every game needs a way to track points! We are building a Score Keeper. And every score starts at... ZERO! 0️⃣ Let us set it up!
What is a Variable? 📦
A variable is a labeled box that holds a value. We use let to make one.
let score = 0
console.log("My score box holds:", score)Why Start at Zero? 🤔
Before you earn any points, you have... none! So we begin at 0. Fair start for everyone!
let score = 0
console.log("Game start! Score:", score)Naming the Score 🏷️
Good names help! score is clearer than x. Coders pick friendly names.
let playerScore = 0
console.log("Player score:", playerScore)Two Players, Two Scores 👥
Playing with a friend? Make a score box for each!
let player1 = 0
let player2 = 0
console.log("P1:", player1, "P2:", player2)Showing the Start Screen 📺
Print a friendly welcome with the starting score.
let score = 0
console.log("Welcome! 🎮")
console.log("Your score: " + score)Numbers, Not Words 🔢
The score is a number, so we write 0 with NO quotes. Quotes are for words!
let score = 0
let name = "Alex"
console.log(name + " has " + score + " points")Reset Back to Zero 🔄
New game? Set the score back to 0 to start fresh!
let score = 42
score = 0
console.log("Reset! Score:", score)A Starting Function 🛠️
Make a helper that gives a fresh starting score. Use it for every new game!
function newGame() {
return 0
}
let score = newGame()
console.log("Fresh score:", score)Score and Lives 💛
Games often track more than one thing! Start lives at 3 and score at 0.
let score = 0
let lives = 3
console.log("Score: " + score + " | Lives: " + lives)Ready to Play! ✅
Your score keeper is set up and starting at zero. Now we are ready to ADD points! 🎉
let score = 0
console.log("Score keeper ready! Starting at " + score + " 🚀")Quick Check ❓
First brain teaser! 🧠
Setup Star! 🌟
Recap! You learned to:
- 📦 Make a
variablewithlet - 0️⃣ Start a score at
0 - 🔢 Use numbers without quotes
- 🔄 Reset for a new game
Next: adding points! ➕
Frequently asked questions
Is the “Starting at Zero” lesson free?
Yes — the full text of “Starting at Zero” 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 “Starting at Zero”?
Set up a score. 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 “Starting at Zero” 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
- Starting at Zero
- Adding Points
- Losing Points
- Showing the Score