Unexpected nested loop behavior in javascript
<p>I'm implementing a sort, and I've run into some unexpected behavior:</p>

<pre><code>var searches = ['beta', 'alpha'];
var i = 0; j = 0;

for(i = 0; i &lt; searches.length; i++){
        min = i;

        // first time through, i = 0
         alert(i); 
        for(j = i; j&lt;searches.length; j++);
        {
            // first time through j = 2. If i = 0, how does j = 2?
             alert(j); 
            // .. sort code
        }
}
</code></pre>

<p>In fact, j is always 2. Why isn't j being set to i when it enters the for loop?</p>

<p>Here's the jsfiddle:
<a href="http://jsfiddle.net/w2kK9/3/" rel="nofollow">http://jsfiddle.net/w2kK9/3/</a></p>
