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

Hi, There :slight_smile: . The console has show the correct message, but it’s still goes wrong. I’m a little bit confusing. :sweat_smile:

const computerResult = getRandomComputerResult();
function getRoundResults(userOption) {
  if (userOption === computerResult) {
    return `It's a tie! Both 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);

You don’t want to include the square brackets around the option/result in your string output. Those are included in the example to signify the type of value to include in the output. They aren’t meant to be literal.

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.