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

Tell us what’s happening:

I don’t seem to find the bug in my code.. whenever I run it , it keeps saying I should return a string. Please I need help and some explanation thanks ..

Your code so far

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

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

function getRoundResults(userOption) {
  const computerResult = getRandomComputerResult();
  if (hasPlayerWonTheRound(userOption, computerResult)) {
    playerWins += 1;
    return `Player wins! ${userOption} beats ${computerResult}`;
  }
  else if (userOption === computerResult) {
    return `It's a tie! Both chose ${userOption}`;
  }
  else {
    computerWins += 1;
    return `Computer wins! ${computerResult} beats ${userOption}`;
  }
}
console.log(getRoundResults("Rock"));
console.log("Player Score: ", playerScore, "Computer Score: ", computerScore);

// User Editable Region
/* file: styles.css */

Your browser information:

User Agent is: Mozilla/5.0 (Linux; U; Android 12; en-ng; CPH2387 Build/SP1A.210812.016) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.98 Mobile Safari/537.36 PHX/16.8

Challenge Information:

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

What errors do you see in the console?

If the player wins the round, update the playerScore by 1 and return the message “Player wins! [player’s choice] beats [computer’s choice]”.

If the computer wins the round, update the computerScore by 1 and return the message "Computer wins! [computer's choice] beats [player's choice]".

Can you double check that these instructions are completed properly?

Thanks I have solved it

@Josh2nice whats the solution i am stuck, i get the right replies on the console but still get an error to return right message

Hi @Tega11 and welcome to our community!

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge. This button only appears if you have tried to submit an answer at least three times.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.