0Pricing
Javascript for Kids · Lesson

Flip Many Times

Count heads and tails.

Flip, Flip, Flip! 🪙

Hello again, coin champion! 🪙 Today we flip the coin MANY times!

And we will count how many Heads and how many Tails we get. 🔢 Let's see if it is fair!

A Counting Box 📦

To count, we need boxes to keep our score! 📦

We make heads start at 0 and tails start at 0. Then we add 1 each time. ➕

let heads = 0;
let tails = 0;
console.log('Heads so far: ' + heads);
console.log('Tails so far: ' + tails);

All lessons in this course

  1. Heads or Tails
  2. Guessing
  3. Checking the Guess
  4. Flip Many Times
← Back to Javascript for Kids