Error in Rock, Paper, or Scissors

I do not know what the error is in this project.

https://www.codecademy.com/paths/web-development/tracks/getting-started-with-javascript/modules/learn-javascript-functions/projects/rock-paper-scissors-javascript

Difficult to say without the code, the exercise url will just open my own code (checks for logged in user), please copy paste your code to the forum

I’m sorry, It was my code.

const getUserChoices = userInput => {
  userInput = userInput.toLowerCase();
    if (userInput === 'rock'|| userInput === 'paper' || userInput === 'scissors'){
      return userInput;
    } else {
      return console.log('Error!');
    }
  }

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!';
  }
  if (userChoice === 'rock') {
    if (computerChoice === 'paper') {
      return 'Computer Win!';
    } else {
      return 'User Win!';
    }
  }
  if (userChoice === 'paper') {
    if (computerChoice === 'scissors'){
      return 'Computer Win!';
    } else {
      return 'User Win!';
    }
  }
   if (userChoice === 'scissors') {
    if (computerChoice === 'rock') {
      return 'Computer Win!';
    } else {
      return 'User 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));

};
	console.log(playGame());

looking at the error line (function call):

const userChoice = getUserChoice('scissors');

and then looking at the function definition:

const getUserChoices = userInput => {

i can see the problem.

Thank you so much for the solution!

Sorry for the late reply,

Can anyone help me with my code, it keeps saying that if (userChoice === ‘paper’) {

ReferenceError: userChoice not defined

and has a “^” pointing under the U in Userchoice

line 36

Here is my whole code so far:


:

What is the problem? The error message tells you what you need to know

According to you, where is the userChoice defined? And does this match with where you attempt to use this variable? Keep scope rules in mind

It was a capitalization issue, thank you for your quick response though! i just reset the project and ran through it again, and it worked out fine.