0Pricing
Javascript for Kids · Lesson

Counting by Steps

Skip values.

Counting by Steps 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.

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 + 2 counts by twos
  • Shortcut: i += 2

Next: counting DOWN like a rocket countdown! 🚀

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, 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 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; 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 “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

  1. Counting Up
  2. Counting by Steps
  3. Counting Down
  4. Number Patterns
← Back to Javascript for Kids