Counting by Steps
Skip values.
Counting by Steps is a free Javascript for Kids lesson on CoddyKit. This is 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, and your progress syncs across the web and the CoddyKit app. The Javascript for Kids course includes 4 lessons in total.
Big Steps! 👣
Last time we counted 1, 2, 3 by adding ONE each time. But what if we want to SKIP? 🦘
Like 2, 4, 6, 8! Today we learn to count by steps.
Change the Step 🔧
The third part of the loop is the step. Instead of i++ (add 1), we can write i = i + 2 to add 2!
for (let i = 2; i <= 10; i = i + 2) {
console.log(i)
}Count by Twos 2️⃣
That printed 2, 4, 6, 8, 10! We skipped all the odd numbers. 🦘
Counting by 2s is great for counting pairs of socks! 🧦
for (let i = 2; i <= 8; i = i + 2) {
console.log(i + ' socks')
}Count by Fives 5️⃣
Now let us count by 5s: 5, 10, 15, 20! Perfect for counting fingers. ✋
for (let i = 5; i <= 20; i = i + 5) {
console.log(i)
}Count by Tens 🔟
Let us count by 10s all the way to 50! Big jumps! 🦘🦘
for (let i = 10; i <= 50; i = i + 10) {
console.log(i)
}Only Odd Numbers 🔢
Start at 1 and step by 2 to get the ODD numbers: 1, 3, 5, 7, 9!
for (let i = 1; i <= 9; i = i + 2) {
console.log(i)
}Count by Threes 3️⃣
Counting by 3s: 3, 6, 9, 12! Just change the step to 3.
for (let i = 3; i <= 12; i = i + 3) {
console.log(i)
}Skip With a Message 📣
Let us count cookies by 2s with a yummy message! 🍪🍪
for (let i = 2; i <= 10; i = i + 2) {
console.log('Box of ' + i + ' cookies')
}A Tiny Trick: += 🪄
Programmers use a shortcut! i += 2 means the same as i = i + 2. Less typing! ✨
for (let i = 0; i <= 8; i += 2) {
console.log(i)
}Count by 100s! 💯
For HUGE jumps, step by 100! Watch us zoom: 100, 200, 300! 🚀
for (let i = 100; i <= 300; i += 100) {
console.log(i)
}Your Turn to Step 🌟
Change the step to 4 and count to 20! Try editing and running. 🦘
for (let i = 4; i <= 20; i += 4) {
console.log(i)
}Quick Check ✅
Step-counting brain check! 🧠
Stepping Recap 🎉
Awesome jumps! 🦘 You learned to count by steps.
- Change the step part to skip values
i = i + 2counts by twos- Shortcut:
i += 2
Next: counting DOWN like a rocket countdown! 🚀
Learn JavaScript with an AI tutor — free
Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.
- Courses
- 35
- Lessons
- 140
Frequently Asked Questions
Is the “Counting by Steps” lesson free?
Yes — the full text of “Counting by Steps” is free to read here on the web. 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. The Javascript for Kids course includes 4 lessons in total.
What will I learn in “Counting by Steps”?
Skip values. 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, so you can start here or from the beginning and move at your own pace. This is lesson 2 of 4.
How long does the “Counting by Steps” 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
- Counting Up
- Counting by Steps
- Counting Down
- Number Patterns