0Pricing
Javascript for Kids · Lesson

Counting Down

Loop backwards.

Counting Down is a free Javascript for Kids lesson on CoddyKit — lesson 3 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.

Blast Off! 🚀

5... 4... 3... 2... 1... LIFTOFF! 🚀

That is counting DOWN! The numbers get SMALLER. Today we make loops count backwards.

Flip the Loop 🔄

To count down, we change 3 things:

  • Start big (like 5)
  • Keep going while i >= 1
  • Step with i-- (subtract 1!)
for (let i = 5; i >= 1; i--) {
  console.log(i)
}

What Is i--? ➖

Remember i++ added 1? Well i-- SUBTRACTS 1! 👇

So the counter shrinks each turn: 5, 4, 3, 2, 1.

for (let i = 3; i >= 1; i--) {
  console.log('Counter is ' + i)
}

Rocket Countdown 🚀

Let us make a real rocket countdown with a liftoff at the end!

for (let i = 5; i >= 1; i--) {
  console.log(i)
}
console.log('Blast off!')

Count Down From 10 🔟

Start higher! Let us count down from 10.

for (let i = 10; i >= 1; i--) {
  console.log(i)
}

Bottles on the Wall 🍾

Let us sing a counting-down song! Bottles going down by 1.

for (let i = 5; i >= 1; i--) {
  console.log(i + ' bottles on the wall')
}

Stop at Zero 0️⃣

Want to include 0? Change the rule to i >= 0!

for (let i = 3; i >= 0; i--) {
  console.log(i)
}

Down by Twos 🦘

You can count DOWN by steps too! Use i -= 2 to subtract 2 each time.

for (let i = 10; i >= 2; i -= 2) {
  console.log(i)
}

New Year Countdown 🎆

10, 9, 8... Happy New Year! Let us count down and celebrate! 🎉

for (let i = 5; i >= 1; i--) {
  console.log(i)
}
console.log('Happy New Year!')

Eating Snacks 🍕

We start with 4 slices and eat one each turn until they are gone!

for (let i = 4; i >= 1; i--) {
  console.log(i + ' slices left')
}
console.log('All gone!')

Your Turn to Count Down 🌟

Change the start to 8 and count down to 1! Edit and run. 🚀

for (let i = 8; i >= 1; i--) {
  console.log(i)
}

Quick Check ✅

Countdown brain check! 🧠

Countdown Recap 🎉

Liftoff complete! 🚀 You learned to count DOWN.

  • Start big, stop when i >= 1
  • Use i-- to subtract 1
  • Count down by steps with i -= 2

Next: making cool number PATTERNS! ✨

Frequently asked questions

Is the “Counting Down” lesson free?

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

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

How long does the “Counting Down” 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. Counting Up
  2. Counting by Steps
  3. Counting Down
  4. Number Patterns
← Back to Javascript for Kids