title: Why does the value of typeof null change inside a loop?
body: <p>Executing this snippet in the Chrome console:</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>function foo() {
      return typeof null === 'undefined';
  }
  for(var i = 0; i &lt; 1000; i++) console.log(foo());</code></pre>
  </div>
  </div>
  </p>
  
  <p>should print 1000 times <code>false</code>, but on some machines will print <code>false</code> for a number of iterations, then <code>true</code> for the rest. </p>
  
  <p><a href="https://i.stack.imgur.com/FuFKT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FuFKT.jpg" alt="enter image description here"></a></p>
  
  <p>Why is this happening? Is it just a bug? </p>