title: Showing the same result in Rock Paper Scissors - Java Script
body: <p>**I am trying to create rock paper scissors in java script and The below is the code I am executing, It is showing "The match is draw! play again" everytime. What goes wrong? </p>
  
  <p>First taking the user input and checking the correctness. Generating the computer input by Math.random and assigning them RPS based on the output. Finally comparing both to determine the winner.**</p>
  
  <pre><code>const getUserChoice = function(userInput){
    userInput = userInput.toLowerCase();
    if (userInput === 'rock'|| userInput ==='paper'|| userInput ==='scissors'){
      return userInput;
    }else {
      console.log('Error');
    }
  }
  
  userChoice = getUserChoice('rock'); 
  console.log(getUserChoice('rock'));
  
  const getComputerChoice = function(){
    randomNumber = Math.floor(Math.random()*3);
    switch(randomNumber) {
      case 0:
      return 'rock';
      break;
      case 1:
      return 'paper';
      break;
      case 2:
      return 'scissors';
      break;
      default:
      return 'error';
    }
  }
  
  computerChoice = getComputerChoice();
  console.log(getComputerChoice());
  
  
  const determineWinner = function(userChoice, computerChoice){
    if (userChoice === computerChoice){
      return 'The match is draw! Play again.';
    }
    if (userChoice === 'rock'){
      if (computerChoice === 'paper'){
        return 'you lost';
      }else{
        return 'you won';
      }
    }
     if (userChoice === 'paper'){
      if (computerChoice === 'rock'){
        return 'you won';
      }else{
        return 'you lost';
      }
    }
  
    if (userChoice === 'scissors'){
      if (computerChoice === 'rock'){
        return 'you lost';
      }else{
        return 'you won';
      }
    } 
      }
  
  console.log(determineWinner());**strong text**
  </code></pre>