const determineWinnner = (userChoice, computerChoice) => {
if (userChoice === computerChoice) {
return ‘This game is a tie’;
}
if (userChoice === ‘rock’) {
if (computerChoice === ‘paper’){
return ‘The computer won!’;
} else {
return ‘User has won!’;
}
}
if (userChoice === ‘paper’) {
if (computerChoice === ‘scissors’){
return ‘The computer has won!’;
} else {
return 'User has won';
}
}
if (userChoice === ‘scissors’) {
if (computerChoice === ‘rock’) {
return ‘Computer has won!’;
} else {
return 'User has won';
}
}
};
console.log(determineWinner(‘rock’, ‘paper’));
Hi all. Here is my code.It keeps throwing determineWinner is undefined. In the console.log ‘paper’ will not appear as a string. The first quotation after the comma stays white and the the word paper is red. The last quotation is yellow but the the two final parenthesis and semi colon are also yellow. No matter what I do this won’t change and I am stuck in the undefined error.
thanks for any insight