Rock Paper Scissors Game

I am working through the Rock, Paper, Scissors game, but, I got an error message I can’t seem to locate. I had missed several {} brackets at first when meeting IF statements, but now that all appears to be in order, nothing is printing to the console when I console.log() to test the determineWinner Function.

here is the error:

/home/ccuser/workspace/javascript_101_Unit_3/Unit_3/rockPaperScissors.js:60
});
^
SyntaxError: Unexpected token )
at createScript (vm.js:53:10)
at Object.runInThisContext (vm.js:95:10)
at Module._compile (module.js:543:28)
at Object.Module._extensions…js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:427:7)
at startup (bootstrap_node.js:151:9)

Here is my code:

const getUserChoice = (userInput) => {
userInput = userInput.toLowerCase();
if (userInput === ‘rock’ || userInput === ‘paper’ || userInput === ‘scissors’) {
return userInput
} else {
console.log(‘error’);
}
};

const getComputerChoice = () => {
const randomNumber = Math.floor(Math.random() * 3);
switch (randomNumber) {
case 0:
return ‘rock’;
break;
case 1:
return ‘paper’;
break;
case 2:
return ‘scissors’;
break;
}
};

const determineWinner = (userChoice, computerChoice) => {
if (userChoice === computerChoice){
return ‘Tie Game, Play Again’;
}
if (userChoice === ‘rock’){
if(computerChoice === ‘paper’){
return ‘Sorry Computer Wins!’;
}else {
return ‘Congratulations, You Win!’;
}
}
if (userChoice === ‘paper’){
if(computerChoice === ‘scissors’){
return ‘Sorry Computer Wins!’;
}else {
return ‘Congratulations, You Win!’;
}
}
if (userChoice === ‘scissors’){
if(computerChoice === ‘rock’){
return ‘Sorry Computer Wins!’;
}else {
return ‘Congratulations, You Win!’;
}
};

console.log(determineWinner(‘rock’,‘paper’));
console.log(determineWinner(‘paper’,‘rock’));
console.log(determineWinner(‘rock’ , ‘rock’));

Any suggestions or advice?

Nevermind, I was missing an instance of {}. Just caught it… :man_facepalming: