title: JavaScript won't change my color when it should, and also weird log. appears
body: <p>So I wanted to code a simple project. When a button is clicked, the program generates a random number between 1 and 50 and then prints it inside my DIV.
  I wanted a little feature that if the number happens to be 18, the background color changes to red. </p>
  
  <p>So I've tried do do this many times, but the background changing randomly. No order or whatsoever. </p>
  
  <p>I've tried to log the numbers, to see is there any connection between the them when it changing to red, but no luck.</p>
  
  <p>However, in the console, a little grey <code>2</code> appears. Also at random times.</p>
  
  <pre><code>function getRandomNumber(){
      var randomNumber = Math.floor(Math.random()*50) + 1;
      return randomNumber;
  }
  myButton.addEventListener('click', ()=&gt;{
      para.innerHTML = getRandomNumber();
      console.log(getRandomNumber());
      if(getRandomNumber() === 18){
          para.style.backgroundColor = "red";
      }
  });
  </code></pre>