0Pricing
Javascript for Kids · Lesson

Adding Points

Increase the score.

Adding Points 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.

Earn Some Points! ➕

Time to make the score go UP! When the player does something great, we add points. Cha-ching! 🎉

Add One Point 1️⃣

To add a point, take the score and add 1: score = score + 1.

let score = 0
score = score + 1
console.log("Score:", score)

The += Shortcut ⚡

score += 1 is a shorter way to add 1. Same result, less typing!

let score = 0
score += 1
console.log("Score:", score)

Add Many Points 🎯

Hard tasks give more points! Add 5 or 10 at once.

let score = 0
score += 5
console.log("You earned 5 points! Score:", score)

Adding Again and Again 🔁

Keep adding as the player keeps winning!

let score = 0
score += 1
score += 1
score += 1
console.log("Score after 3 wins:", score)

Add Points in a Loop 🌀

Won 5 rounds? A loop adds points for each one!

let score = 0
for (let i = 0; i < 5; i++) {
  score += 1
}
console.log("Score:", score)

Only Add When You Win ✅

Use if so points are added ONLY when the player did well.

let score = 0
let won = true
if (won) {
  score += 10
}
console.log("Score:", score)

A Point Adding Function 🛠️

Make a helper that adds points to a score. Reuse it anytime!

function addPoints(score, amount) {
  return score + amount
}
let myScore = addPoints(0, 5)
console.log("Score:", myScore)

Celebrate Each Point 🎉

Cheer when points go up! It feels great for the player.

let score = 0
score += 1
console.log("Nice! +1 point! 🎉 Total:", score)

Combo Bonus! 🔥

Add a bonus for doing many things in a row! Extra fun.

let score = 10
let combo = true
if (combo) {
  score += 5
  console.log("COMBO BONUS! 🔥")
}
console.log("Score:", score)

Points Are Working! ✅

You can now add points one at a time, in big chunks, in loops, and only when earned. Awesome! 🚀

let score = 0
score += 3
score += 7
console.log("Total score: " + score + " 🌟")

Quick Check ❓

Add up your knowledge! 🧠

Point Pro! 🏅

Recap! You learned to:

  • ➕ Add points with +=
  • 🎯 Add many points at once
  • 🌀 Add points in a loop
  • ✅ Add only when won is true

Next: losing points! 😬

Frequently asked questions

Is the “Adding Points” lesson free?

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

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

How long does the “Adding Points” 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. Starting at Zero
  2. Adding Points
  3. Losing Points
  4. Showing the Score
← Back to Javascript for Kids