title: score stops at 5 some times, but other times it will just keep going. How to fix this
body: <p>When running this function the first few times, it will work and display if I won the game or not when the score hits 5. But other times the score will keep incrementing (6, 7, 8, and so on). Why does the score not stop at 5 sometimes, and how do I stop this from happening?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    const playerText = document.querySelector("#playerText");
  const computerText = document.querySelector("#computerText");
  const resultText = document.querySelector("#resultText");
  const choiceBtns = document.querySelectorAll(".choiceBtn");
  
  let player;
  let computer;
  
  
  let playerScore = 0;
  let computerScore = 0;
  
  
  
  choiceBtns.forEach(button =&gt; button.addEventListener("click", () =&gt; {
  
      player = button.textContent;
      computerSelection();
      playerText.textContent = "Player: " + player;
      computerText.textContent = "Computer: " + computer;
      resultText.textContent = "Result: " + result();
  }));
  
  
  
  function computerSelection(){
  
      const randNum = Math.floor(Math.random() * 3) + 1;
  
      switch(randNum){
        case 1:
          computer = "rock";
          break;
        case 2:
          computer = "paper";
          break;
        case 3:
          computer = "scissors";
          break;
      }
  }
  
  function disable() {
      document.getElementById("rock").disabled = true;
      document.getElementById("paper").disabled = true;
      document.getElementById("scissors").disabled = true;
  
    }
  
  
  
  function result() {
      if ((player === "paper" &amp;&amp; computer === "rock") || 
          (player === "scissors" &amp;&amp; computer === "paper") || 
          (player === "rock" &amp;&amp; 
              computer === "scissors" &amp;&amp;
              (computerScore &lt;=5 &amp;&amp; playerScore &lt;=5 )))
          
          {
         
          playerScore += 1;
          resultText.textContent = ("You win! " + "Player score: " + playerScore + " Computer score: " + computerScore);
          
          return resultText.textContent;
          }
      
      if (playerScore == 5) {
          
          resultText.textContent = ("Winner winner chicken dinner! You won the game! " + " Player score: " + playerScore + "Computer score: " + computerScore);
          computerScore = 0;
          playerScore = 0;
          disable();
          return resultText.textContent;
          
      }
    
  
      
      else if 
          ((player === "rock" &amp;&amp; computer === "paper") || 
          (player === "paper" &amp;&amp; computer === "scissors") || 
          (player === "scissors" &amp;&amp; 
          
              computer === "rock" &amp;&amp; 
              (playerScore &lt;=5 &amp;&amp; computerScore &lt;=5))
          
          
          ) {
  
          
          computerScore += 1;
          resultText.textContent = ("You lose! "+ "Player score: " + playerScore + " Computer score: " + computerScore); 
          
          return resultText.textContent;
      
      }
          if (computerScore == 5) {
          
              
              
              resultText.textContent = ("You lost the game!!!!! " + " Player score: " + playerScore + " Computer score: " + computerScore);
              computerScore = 0;
              playerScore = 0;
              disable();
              return resultText.textContent;
  
              
          }
      
  
      else (computer == player)
  {
      resultText.textContent = ("Draw! " + "Player score: " + playerScore + " Computer score: " + computerScore);
      
      return resultText.textContent;
  
  } 
  
  }  </code></pre>
  </div>
  </div>
  </p>
  <p>When running this function the first few times, it will work and display if I won the game or not when the score hits 5. But other times the score will keep incrementing (6, 7, 8, and so on). Why does the score not stop at 5 sometimes, and how do I stop this from happening?</p>