Tell us what’s happening:
I don’t know what’s wrong with my code.
It says “Your getRoundResults function should return the correct message based on who wins the round. If no one wins, the message should say it’s a tie.”
Help please
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 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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Challenge Information:
Review DOM Manipulation by Building a Rock, Paper, Scissors Game - Step 3