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

Tell us what’s happening:

I’ve tried wrapping return with " and '. Neither work. I don’t know what I’m missing!

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 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 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36

Challenge Information:

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

Still having trouble figuring Step 3 out: Rock, Paper, Scissors.

SyntaxError: unknown: Missing semicolon. (21:17)

19 |
20 | if (userOption === computerResult) {

21 | return 'It’s a tie! Both chose ${userOption}
| ^
22 | }
23 | else if (hasPlayerWonTheRound(userOption, computerResult)) {
24 | playerScore++

nvm I figured it out

1 Like

(hasPlayerWonTheRound(userOption, computerResult))
Can someone to explain to me what does this mean ? Because this i still can’t figure it out!

In the future, please create your own topic when you have specific questions about your own challenge code. Only respond to another thread when you want to provide help to the original poster of the other thread or have follow up questions concerning other replies given to the original poster.

The easiest way to create a topic for help with your own solution is to click the Ask for Help button located on each challenge. This will automatically import your code in a readable format and pull in the challenge url while still allowing you to ask any question about the challenge or your code.

Thank you.