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

Tell us what’s happening:

I don’t know what’s wrong with my code.
It says “Your getRoundResults function should return the correct message based on who wins the round. If no one wins, the message should say it’s a tie.”
Help please :slight_smile:

Your code so far

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

/* file: styles.css */

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

function getRoundResults(userOption) {
  const computerResult = getRandomComputerResult();
  if (userOption === computerResult) {
    return `It's a tie! Both players chose ${userOption}.`
  } else if (hasPlayerWonTheRound(userOption, computerResult)) {
    playerScore++;  
    return `Player wins! ${userOption} beats ${computerResult}.`
  } else {
    computerScore++;  
    return `Computer wins! ${computerResult} beats ${userOption}.`
  }
}

console.log(getRoundResults("Rock"));
console.log("Player Score: ", playerScore, "Computer Score: ", computerScore);

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36

Challenge Information:

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

Can you check all the strings carefully? For eg this one should not have the word players in it.

Thanks for the answer. I delete the word players but the problem has not been solved :frowning:

the problem is in your strings. they’re not an exact match.
Delete all the periods at the end of each statement.

Omg thank you so much :partying_face:

1 Like