title: `setInterval` Apparent Infinite Loop
body: <p>When I open the HTML with the below JavaScript, <code>starting timer</code> gets logged in the console, but then my mouse icon just spins.</p>
  
  <pre><code>window.onload = function() {
      console.log("starting timer");
      var n = 0;
      var id = setInterval(function() { console.log("hello"); n++ }, 100);
      while(true) {
          if( n &gt; 5 ) {
                clearInterval(id);
                break;
          }
      }
      console.log("finished timer");
  }
  </code></pre>
  
  <p>Am I creating some type of infinite loop here?</p>