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

Tell us what’s happening:

not sure whats wrong i keep getting the hint that your get round results should return a string not sure what that means but i double checked the code and the logic seems right

Your code so far

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

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

function getRoundResults(userOption) {
  const computerResult = getRandomComputerResult();
  if (hasPlayerwonTheRound(userOption, computerResult)) {playerScore++;
  return `Player wins! ${userOPtion} beats ${computerResult}`;}
  else if (computerResults === userOption) {
return `Its a tie! Both chose ${userOption}`;}
else {
  computerScore++;
  return `Computer wins! ${computerResults} 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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36

Challenge Information:

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

Double check your variable names

i double checked all the vairables i even went to the next project to look at the old code it all seems right

1 Like

Hi there!
In the condition, computerResult is unnecessary
Also You have misspelled variables names in return statemens. Carefully check. If you look closely, you can see three blue dots under the wrong variable names.

did you?   

im confused so i dont have to use computerResults at all

Reset the challenge step to restore the original code back. Then read your all previous code carefully. Then try to code the challenge step using correct function’s and variable`s names.

computerResult

vs

computerResults