Counting Up
Loop with numbers.
Counting Up 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.
Let Us Count! 🔢
Have you ever counted out loud? 1, 2, 3, 4, 5! 🙌
Computers love counting too! We use a loop to count without typing every number ourselves.
The Lazy Way 😴
Imagine counting to 100 by typing each console.log... yawn! 💤
A loop does the boring repeating for us, so we can be lazy AND smart!
Meet the For Loop 🔁
A for loop has 3 parts:
- Start: where to begin
- Keep going: when to stop
- Step: how to count
Let us see one count from 1 to 5!
for (let i = 1; i <= 5; i++) {
console.log(i)
}What Is i? 🤔
The i is our counter. It is like a finger pointing at each number! 👆
It starts at 1, and i++ means 'add 1 to i' every time.
for (let i = 1; i <= 3; i++) {
console.log('Count: ' + i)
}Start From Zero 0️⃣
Computers often like to start counting at 0! Let us count 0, 1, 2, 3, 4.
for (let i = 0; i < 5; i++) {
console.log(i)
}Count to 10 🔟
Want to count higher? Just change the stop number! Let us go to 10.
for (let i = 1; i <= 10; i++) {
console.log(i)
}Counting Sheep 🐑
Cannot sleep? Let us count sheep! We can add words to each number.
for (let i = 1; i <= 5; i++) {
console.log(i + ' sheep')
}Blast Off Countdown? 🚀
This loop counts UP. Each turn, the counter gets bigger by 1.
Watch the numbers grow like a rocket gaining speed!
for (let i = 1; i <= 4; i++) {
console.log('Floor ' + i)
}
console.log('Top!')Use the Counter in Math ➕
The counter is just a number, so we can do math with it!
Let us double each number.
for (let i = 1; i <= 5; i++) {
console.log(i * 2)
}Repeat a Message 📣
Loops are great for repeating! Let us cheer 3 times.
for (let i = 1; i <= 3; i++) {
console.log('Hip hip hooray!')
}Your Turn to Count 🌟
Try changing the stop number to count to 7! Just edit and run. 🚀
for (let i = 1; i <= 7; i++) {
console.log(i)
}Quick Check ✅
Counting brain check! 🧠
Counting Up Recap 🎉
Great counting! 🔢 You learned the for loop.
- Start the counter (like
i = 1) - Stop when a rule is true (like
i <= 5) - Step with
i++to add 1
Next: counting by BIG steps like 2, 4, 6! 👣
Frequently asked questions
Is the “Counting Up” lesson free?
Yes — the full text of “Counting Up” 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 Up”?
Loop with numbers. 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 “Counting Up” 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.