Rock Paper Scissors help

Hi everyone, I am having an issue with this. It seems that if the game ends in a tie, it will correctly say ‘Tie!’ but if either the user or computer wins it says undefined. I’m sure the answer is simple but I cannot seem to solve it.

const getUserChoice = userInput => {
  userInput = userInput.toLowerCase();
  if (userInput === 'rock' || userInput === 'paper' || userInput === 'scissors') {
    return userInput;
  } else {
    console.log('Choose either Rock Paper or Scissors');
  }
}

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

const determineWinner = (userChoice, computerChoice) => {
  if (userChoice === computerChoice) {
    return 'Tie!';
  } else if(userChoice === 'rock') {
    if (computerChoice === 'paper') {
      return 'Computer wins!'
      } else { 
        return 'You win!'
      } 
   } else if (userChoice === 'paper') {
    if (computerChoice === 'scissors') {
      return 'Computer wins!'
    } else {
      return 'You win!'
    }
  } else if (userChoice === ' scissors') {
    if (computerChoice === 'rock') {
      return 'Computer wins!'
    } else {
      return 'You win!'
    }
  }   
  }

const playGame = () => {
  const userChoice = getUserChoice('scissors');
  const computerChoice = getComputerChoice();
  console.log('You threw: ' + userChoice);
  console.log('The Computer threw: ' + computerChoice);

  console.log(determineWinner(userChoice, computerChoice));
};

playGame();

Goes fine if the user picks rock or paper, which means something is wrong here:

  } else if (userChoice === ' scissors') {

there is a space at the start of your string, which causes the problem

ha so simple. Thank you