Javascript for Kids · Lesson

The Remainder Trick

Find what is left over with the % operator.

Lesson 3 of 413 steps

The Remainder Trick is a free Javascript for Kids lesson on CoddyKit. This is 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, and your progress syncs across the web and the CoddyKit app. The Javascript for Kids course includes 4 lessons in total.

A Secret Trick!

Hello, wizard! 🧙 Today you learn a super cool secret: the remainder trick! 🎩

What Is a Remainder?

Sometimes when you share things, some are left over. 🍪

The leftover amount is called the remainder!

The Percent Sign

We use % (the percent sign) to find the remainder. 🪄

It tells you what is left over after sharing!

Try the Remainder

Share 7 cookies among 2 friends. Run this to see the leftover! 🍪

console.log(7 % 2)

Why 1 Is Left

7 cookies shared by 2: each gets 3, and 1 is left over! 🍪

So 7 % 2 is 1. Neat trick!

No Leftovers

If it shares evenly, the remainder is 0! Run this. ✨

console.log(10 % 5)

Sharing Candy

You have 13 candies for 4 kids. How many are left over? 🍬 Run it!

console.log(13 % 4)

Odd or Even?

The remainder trick can check odd or even! 🔢

If number % 2 is 0, it is even. If it is 1, it is odd!

Is 8 Even?

Run this. If you see 0, the number is even! 🎯

console.log(8 % 2)

Is 9 Even?

Run this. If you see 1, the number is odd! 🎯

console.log(9 % 2)

A Handy Trick

The remainder trick helps share things and check odd or even. 🪄

Coders use it all the time!

Quick Check

Remainder quiz! 🎩

Remainder Wizard!

Hooray! 🎉 You learned the remainder trick with %.

Now you can find leftovers and check odd or even! 🧙✨

Free to start

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 “The Remainder Trick” lesson free?

Yes — the full text of “The Remainder Trick” 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 “The Remainder Trick”?

Find what is left over with the % operator. 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 3 of 4.

How long does the “The Remainder Trick” 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. Adding and Subtracting
  2. Multiplying and Dividing
  3. The Remainder Trick
  4. Math with Variables
← Back to Javascript for Kids