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
- Heads or Tails
- Guessing
- Checking the Guess
- Flip Many Times