title: Building a Rock/Paper/Scissors game with HTML/Javascript but not getting the desired output
body: <p>I am pretty new to coding still, so I apologize in advance if this seems super basic. I've been doing The Odin Project and have made it to the RPS assignment. Now, I've kind of been playing with different iterations of the code just to get a better idea as to how things could work.</p>
  
  <p>Right now I am just putting script tags in an html file to get the desired result and running the function through a <code>console.log()</code> in my browser. The issue I am having is that even when I run the function with the right inputs - I sometimes get the final else statement. I'll post the code below and then try to explain in greater detail what I mean.</p>
  
  <pre><code>&lt;script&gt;
  
  
      function game(playerSelection) { 
  
          playerSelection = playerSelection.toLowerCase();
  
          function computerSelection() { 
          let cAnswer = Math.floor(Math.random() * 3 + 1);
          if (cAnswer == 1) {
              return 'rock';
          } else if (cAnswer == 2) {
              return 'paper';
          } else {
              return 'scissors';
          }
      }
  
          if (playerSelection == computerSelection()) {
              return 'It\'s a tie! Try again.'
          } else if (playerSelection == 'rock' &amp;&amp; computerSelection() == 'scissors') {
              return 'Rock beats scissors, you win!'
          } else if (playerSelection == 'rock' &amp;&amp; computerSelection() == 'paper') {
              return 'Paper beats rock, you lose!'
          } else if (playerSelection == 'paper' &amp;&amp; computerSelection() == 'scissors') {
              return 'Scissors beats scissors, you lose!'
          } else if (playerSelection == 'paper' &amp;&amp; computerSelection() == 'rock') {
              return 'Paper beats rock, you win!'
          } else if (playerSelection == 'scissors' &amp;&amp; computerSelection() == 'paper') {
              return 'Scissors beats paper, you win!'
          } else if (playerSelection == 'scissors' &amp;&amp; computerSelection() == 'rock') {
              return 'Rock beats scissors, you lose!'
          } else {
              return 'It doesn\'t seem like you typed a valid option. Please type \'Rock\', \'Paper\', or \'Scissors\''
          }
      }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Whenever I run <code>console.log(game('scissors'))</code> for instance, I still occasionally get the final else statement from my if ... else block. Shouldn't that be impossible? When I go through it - as long as I type rock, paper, or scissors, I thought I should be hitting one of the other if statements before reaching the final else in the block. But still, sometimes the output I get in my console is 'It doesn't seem like you typed a valid option. Please type 'Rock', 'Paper', or 'Scissors</p>
  
  <p>I imagine I didn't explain this very well so please let me know if I can help clarify.</p>
  
  <p>Thank you!</p>