Rock, paper, scissors project problem

Hi, I’m trying to complete this project:

but for some reason, I keep getting the following error: “});
** ^**
SyntaxError: Unexpected token )

I’ve tried commenting out parts of the code, and it appears that the part where I define the “determineWinner” function causes this error. but I simply don’t see what might be causing it. Can someone help me, please?


const getUserChoice = userInput => {
  userInput = userInput.toLowerCase();
    if (userInput === 'rock' || userInput === 'paper' || userInput === 'scissors') {
      return userInput;
    } else {
      console.log('Error! Please, enter a valid option for this game: rock, paper or scissors');

function getComputerChoice() {
    let choice =  Math.floor(Math.random() * 3);
    switch (choice) {
      case 0:
      return 'rock'
      case 1:
      return 'paper'
      case 2:
      return 'scissors'
      return 'error! something went wrong'

let userChoice = getUserChoice;
let computerChoice = getComputerChoice;

function determineWinner(userChoice, computerChoice) {
  if (userChoice === computerChoice) {
  return 'This game was a tie! One more try, then?'

You’re missing a closing curly bracket for the determineWinner function.


thanks for your help! this error was really bothering me a lot :sweat_smile:

No problem. We’ve all done it when starting out. It’s hard to see missing brackets and typos. When you start coding in an editor, it becomes easier to spot such things because of built-in features and extensions.

1 Like