0Pricing
Javascript for Kids · Lesson

Even and Odd

Tell them apart.

Even and Odd 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.

Welcome to Number Patterns! 🔢

Hi, number explorer! 👋 We are starting Number Patterns! 🔢

First, let's learn about even and odd numbers. Even numbers can be split into two equal teams. Odd numbers always have one left over! ⚖️

Even and Odd 🤔

Even numbers: 2, 4, 6, 8... they split into pairs! 👫

Odd numbers: 1, 3, 5, 7... always one lonely one left! 🙋

How can the computer tell them apart? Let's find out! 🔍

console.log('Even: 2, 4, 6, 8');
console.log('Odd: 1, 3, 5, 7');

The Magic Remainder 🪄

There is a magic tool called % (the remainder). 🪄

It tells us what is LEFT OVER after dividing. 6 % 2 means: divide 6 by 2, what is left? 🤔

console.log(6 % 2);
console.log(7 % 2);

0 Means Even! ✅

Did you see? 6 % 2 is 0 (nothing left over). That means 6 is EVEN! ✅

7 % 2 is 1 (one left over). That means 7 is ODD! 🙋

console.log('8 % 2 = ' + (8 % 2) + ' (even!)');
console.log('9 % 2 = ' + (9 % 2) + ' (odd!)');

Ask the Computer ❓

Let's ask: is the remainder 0? We use === 0. ❓

If yes, the number is even! ✅

let number = 10;
console.log('Is 10 even? ' + (number % 2 === 0));

Even or Odd Decision 🔀

Now let's use if to say it out loud! 🔀

If remainder is 0, say even. Otherwise, say odd! 🗣️

let number = 7;
if (number % 2 === 0) {
  console.log(number + ' is EVEN! ✅');
} else {
  console.log(number + ' is ODD! 🙋');
}

Try Different Numbers 🎲

Change the number and run it! 🎲

Try 12, then try 15. The computer always knows! 🤖

let number = 12;
if (number % 2 === 0) {
  console.log(number + ' is EVEN! ✅');
} else {
  console.log(number + ' is ODD! 🙋');
}

An Even-Odd Machine 🛠️

Let's make a machine that checks any number! 🛠️

Give it a number, get back 'even' or 'odd'! 🤖

function evenOrOdd(number) {
  if (number % 2 === 0) {
    return 'even ✅';
  } else {
    return 'odd 🙋';
  }
}
console.log('4 is ' + evenOrOdd(4));
console.log('5 is ' + evenOrOdd(5));

Check a Bunch! 📋

Let's check numbers 1 through 6 with a loop! 📋

The loop checks each one and tells us even or odd! 🔁

function evenOrOdd(n) {
  return n % 2 === 0 ? 'even ✅' : 'odd 🙋';
}
for (let i = 1; i <= 6; i = i + 1) {
  console.log(i + ' is ' + evenOrOdd(i));
}

Spot the Pattern 👀

Look at the list! Do you see the pattern? 👀

odd, even, odd, even... they take turns! Like a zigzag! 🔀 Numbers love patterns! 🎉

function evenOrOdd(n) {
  return n % 2 === 0 ? 'even' : 'odd';
}
for (let i = 1; i <= 8; i = i + 1) {
  console.log(i + ': ' + evenOrOdd(i));
}

You Know Even and Odd! 🏆

Great job! 🏆 You can tell even and odd apart!

  • 🪄 % gives the remainder
  • ✅ Remainder 0 means EVEN
  • 🙋 Remainder 1 means ODD

Next: skip counting by twos and fives! ⏭️

Quick Check ✅

Brain time! 🧠 How do we know if a number is even?

Lesson Recap 🎀

Awesome, number detective! 🎀 Today you learned:

  • 🪄 % finds the remainder
  • ✅ Even: remainder is 0
  • 🙋 Odd: remainder is 1
  • 🔀 Even and odd take turns

Next: skip counting! ⏭️

Frequently asked questions

Is the “Even and Odd” lesson free?

Yes — the full text of “Even and Odd” 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 “Even and Odd”?

Tell them apart. 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 “Even and Odd” 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. Even and Odd
  2. Skip Counting
  3. Multiplication Patterns
  4. Pattern Printer
← Back to Javascript for Kids