Paper Rock Scissors Project - Undefined

I’m almost finished with the Paper, Rock, Scissors project but when I run the program, I keep getting the same result:

You threw: paper
The computer threw: undefined
You WIN!

Don’t get me wrong, I like winning all the time. But I can’t find the issue here.

const getUserChoice = (userInput) => {
  userInput = userInput.toLowerCase();
  if (
    userInput === "rock" ||
    userInput === "scissors" ||
    userInput === "paper"
  ) {
    return userInput;
  } else {
    console.log("Error:  Please type: 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 = (getUserChoice, getComputerChoice) => {
  if (getUserChoice === getComputerChoice) {
    return "This game is a tie!";
  }
  if (getUserChoice === "rock") {
    if (getComputerChoice === "paper") {
      return "Sorry, computer won!";
    } else {
      return "You WIN!";
    }
  }
  if (getUserChoice === "paper") {
    if (getComputerChoice === "scissors") {
      return "Sorry, computer won!";
    } else {
      return "You WIN!";
    }
  }
  if (getUserChoice === "scissors") {
    if (getComputerChoice === "rock") {
      return "Sorry, computer won!";
    } else {
      return "You WIN!";
    }
  }
};
const playGame = () => {
  const userChoice = getUserChoice("paper");
  const computerChoice = getComputerChoice();
  console.log("You threw: " + userChoice);
  //console.log(`You threw ${userChoice}`); This is string interpolation instead of code used below.  Both works.
  console.log("The computer threw: " + computerChoice);

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

UPDATE: I figured out the undefined issue but the programs is still not randomly generating. Every time I hit run, if comes back with the same result:

You threw: paper
The computer threw: rock
You WIN!

const getUserChoice = (userInput) => {
  userInput = userInput.toLowerCase();
  if (
    userInput === "rock" ||
    userInput === "scissors" ||
    userInput === "paper"
  ) {
    return userInput;
  } else {
    console.log("Error:  Please type: 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 "This game is a tie!";
  }
  if (userChoice === "rock") {
    if (computerChoice === "paper") {
      return "Sorry, computer won!";
    } else {
      return "You WIN!";
    }
  }
  if (userChoice === "paper") {
    if (computerChoice === "scissors") {
      return "Sorry, computer won!";
    } else {
      return "You WIN!";
    }
  }
  if (userChoice === "scissors") {
    if (computerChoice === "rock") {
      return "Sorry, computer won!";
    } else {
      return "You WIN!";
    }
  }
};
const playGame = () => {
  const userChoice = getUserChoice("paper");
  const computerChoice = getComputerChoice();
  console.log("You threw: " + userChoice);
  //console.log(`You threw ${userChoice}`); This is string interpolation instead of code used below.  Both works.
  console.log("The computer threw: " + computerChoice);

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

Last update! There is nothing wrong with the code. It was a PICNIC (Person in chair, not in computer). I simply wasn’t manually changing my choice in the code. Nothing to see here. Thanks anyway! :slight_smile: