title: comparing event listener with variable integer
body: <p>I'm actually practicing with event listener. I'm trying to do a very simple game where an arrow shows up and the user matches it on the keyboard . If it's correct score increases and if it's not score is reset.</p>
  <p>It's working ok but when the arrow is not matched the if statement who resets the score is not triggered and the score is increased instead.</p>
  <p>Here is my code (i apologize it's not clean)</p>
  <pre><code>const fleche = document.querySelector('.fas');
  const showScore = document.querySelector('#score');
  window.addEventListener('keydown',compare);
  let score = 0;
  let jet = 0;
  
  showScore.innerHTML=`Score : ${score}`;
  function jetdes(){
       jet = Math.floor(Math.random()*4+1);
       randomArrow();
  }
  function randomArrow(){
  switch (jet) {
      
      case 1:
          fleche.classList.remove('fa-arrow-up','fa-arrow-down','fa-arrow-left','fa-arrow-right');
          fleche.classList.add('fa-arrow-up');
          
      break;
      case 2:
          fleche.classList.remove('fa-arrow-up','fa-arrow-down','fa-arrow-left','fa-arrow-right');
          fleche.classList.add('fa-arrow-down');
          
      break;
      case 3:
          fleche.classList.remove('fa-arrow-up','fa-arrow-down','fa-arrow-left','fa-arrow-right');
          fleche.classList.add('fa-arrow-left');
          
      break;
      case 4:
          fleche.classList.remove('fa-arrow-up','fa-arrow-down','fa-arrow-left','fa-arrow-right');
          fleche.classList.add('fa-arrow-right');
          
      break;
  }}
  
  function compare(e){
  if(e.code='ArrowUp' &amp;&amp; jet === 1){
      score++;
      showScore.innerHTML=`Score : ${score}`;
      console.log(1);
      jetdes();
      
  }
  else if(e.code='ArrowDown' &amp;&amp; jet === 2){
      score++;
      showScore.innerHTML=`Score : ${score}`;
      console.log(2);
      jetdes();
      
  }
  else if(e.code='ArrowLeft' &amp;&amp; jet === 3){
      score++;
      showScore.innerHTML=`Score : ${score}`;
      console.log(3);
      jetdes();
      
  }
  else if(e.code='ArrowRight' &amp;&amp; jet === 4){
      score++;
      showScore.innerHTML=`Score : ${score}`;
      console.log(4);
      jetdes();
      
  }
  else {
      score = 0;
      showScore.innerHTML=`Score : ${score}`;
      console.log(5);
      jetdes();
      
  }
  }
  
  jetdes();
  </code></pre>
  <p>I know it's probably an obvious mistake but i've been scratching my head over that for a while.</p>
  <p>Thanks !</p>