How do you stop an infinite loop in Javascript?
<p>Let's say I accidentally wrote this:</p>

<pre><code> do { } while (true);
</code></pre>

<p>...and then ran it. Apart from killing your browser, is there a way to stop javascript execution (the equivalent of Ctrl+Break in basic, or Ctrl+C)?</p>

<p>Normally, after about 30 seconds your browser asks if you want to stop the long-running script, but this doesn't always happen (as I just found out)!</p>

<p>FYI: A simple loop such as this: <code>for (i=1; i &gt; 0; ++i);</code> will cause my browser to crash (Firefox 3.5b4). I don't feel much like testing to see if it's any of my add-ons. Continuously restarting my browser isn't my idea of a fun Monday night.</p>
