Tell us what’s happening:
Keeps saying “getRoundResults should return a string”
Error message:
ntaxError: unknown: Unexpected token (25:4)
23 | return Player wins! ${userOption} beats ${computerResult}
24 | }
25 | else {
| ^
26 | computerScore++
27 | returnComputer wins! ${computerResult} beats ${userOption}
28 | }
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 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 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0
Challenge Information:
Review DOM Manipulation by Building a Rock, Paper, Scissors Game - Step 3