0Pricing
Javascript for Kids · Lesson

Checking the Guess

Compare results.

Did You Win? 🏆

Welcome back! 🪙 Now for the most exciting part: checking the guess! 🔍

We need to compare what the player guessed with what the coin showed. If they match, the player WINS! 🏆

Comparing Two Things ⚖️

To compare two things in JavaScript, we use === (three equal signs). ⚖️

It asks: are these two things exactly the same? It answers true or false. ✅❌

console.log('Heads' === 'Heads');
console.log('Heads' === '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