Tell us what’s happening:
Hello. I am just looking to see if anyone else may have an issue with this. I have no issues running this code from VSCode. Everything runs correctly, however the code does not work on the site.
I continuously receive this issues:
- Your getRoundResults should return a string
- 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.
I am receiving the error on the site. VSCode shows no errors. Any ideas?
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
let computerScore = 0;
let playerScore = 0;
function getRoundResults(userOption) {
const computerResult = getRandomComputerResult();
if(hasPlayerWonTheRound(userOption, computerResult)){
playerScore++;
return `Player Wins! ${userOption} beats ${computerResult}`
} else if(userOption === computerResult) {
return `It's a tie! Both chose ${userOption}`
} 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:140.0) Gecko/20100101 Firefox/140.0
Challenge Information:
Review DOM Manipulation by Building a Rock, Paper, Scissors Game - Step 3