Why does this while loop freeze my page?
<pre><code>var f = 5, d;

while (f === 5) d = 2;

alert(d);
</code></pre>

<p>Why does this freeze my page. I thought only when the page is doing a document.write, alert, or console.log inside a while loop (without a incremented value with a limit) it will freeze the page, but not with variables... Do I still have to have a <code>var i = 0; while (i &lt; 5 &amp;&amp;...</code> just to get this to work?</p>

<p>EDIT: I found this in the source-code of google. This while loop doesn't have a number limit but it doesn't freeze the page:</p>

<pre><code>while (a &amp;&amp; !(a.getAttribute &amp;&amp; (b = a.getAttribute("eid")))) a = a.parentNode;
</code></pre>
