title: JS clearInterval does not delete the intervaID
body: <p>I want to build a stopWatch. You can start and pause.  My approach. I start a setInterval and when pause is clicked, I delete the intervalID and set intervalID (global) to zero. However, the interval is not deleted. What am I doing wrong? I suspect that I am assuming something wrong. I expect the interval ID after clear and restart to be the same and not the next higher number.  I use Firefox on OS.</p>
  <p>My code:</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 o = document.querySelector("div");
  const b = document.querySelector("button");
  let intervalID = null;
  let timer;
  
  b.addEventListener("click", () =&gt; {
    if (intervalID !== null) {
      console.log("instance already running lets clear Interval by IntervalIdD");
      clearInterval(intervalID);
      console.log("interval_cleared",intervalID);
      intervalID = null;
      return;  
    } 
    
    intervalID = setInterval(function() {
      console.log(123)
    }, 1000);
  
    console.log("interval",intervalID);
  })</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div&gt;0&lt;/div&gt;
  &lt;button&gt;Start / Stop&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>