Review DOM Manipulation by Building a Rock, Paper, Scissors Game - Step 2

Tell us what’s happening:

I have read MDN articles and W3 Schools pages and I still can’t come up with the correct syntax to find if both choices are the same.

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

function hasPlayerWonTheRound(player, computer) {
      
    if ("Rock", "Scissors") {
      return true;
      }

    else if (player =="Scissors", computer =="Paper") { 
      return player == true
      }
    
    else if (player =="Paper", computer =="Rock") { 
     return player == true 
     }
    
    else if (player=="Rock" && computer=="Rock") {
      return false
    }
    
    else if (player=="Paper" && computer=="Paper") {
      return false
    }
    else (player=="Scissors" && computer=="Scissors") {
      return false
}

console.log(hasPlayerWonTheRound("Rock", "Scissors")); 
console.log(hasPlayerWonTheRound("Scissors", "Rock")); 

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36

Challenge Information:

Review DOM Manipulation by Building a Rock, Paper, Scissors Game - Step 2

Hi @jfo0707

What is this part of your function doing?

Happy coding

Hi.
You’re on the right lines, there are just a few minor edits you need to make.
First, where you use commas in the if and else if statements, you will need to change this to “&&”. There is also another mistake with your if statement - compare it with the else if statements below.