What wrong with this code? Why wouldn't it getComputerChoice log to console. Why is else giving an error?

// I am following the exact instructions on this video. https://www.youtube.com/watch?time_continue=726&v=cKbN6-1ZQ3A&feature=emb_title.

// Help!

const getUserChoice = (userInput) => {

  userInput = userInput.toLowerCase(); 

if (userInput === 'rock' || userInput === 'paper' || userInput === 'scissors'); {

  return userInput;

} else {

  console.log ('Your options are rock, paper, scissors.');



const getComputerChoice = () => {

  const randomNumber = Math.floor(Math.random() * 3);

    swtich (randomNumber) { 

  case 0: 

    return 'rock';

  case 1:

    return 'paper';

  case 2:

    return 'scissors';



const determineWinner (userChoice, computerChoice) => {

  if(userChoice === computerChoice); {

  return 'This game is a tie'




Hello, @javasolver76157, and welcome to the forums!

I don’t believe I’m familiar with the swtich statement. :wink:

As for your SyntaxError: Unexpected token else error, it points to this line:

If the else is unexpected, then it isn’t following an if statement. Do you see the syntax error in the if statement above the unexpected else?

You have another syntax error below: