why does statement below loop executes before termination of loop
<p>I was wondering why do i get alert before printing all vlaues </p>

<pre><code>&lt;script&gt;
    for(var i=0; i&lt;=1000; i++)
    {
        console.log(i);
    }
    alert('Hello');
&lt;/script&gt;
</code></pre>
