For loop and hoisting
<p>I have a question.<br>
For example I use <code>for</code> loop like this:</p>

<pre><code>for ( var i = 0; i &lt; some_length; i++ ) {
    /* some code */
}
</code></pre>

<p>After that variable <code>i</code> is hoisted.<br>
Does it mean that I always should declare <code>i</code> variable at the beginning of the scope?</p>

<pre><code>var i;

for ( i = 0; i &lt; some_length; i++ ) {
    /* some code */
}
</code></pre>

<p>UPD:<br>
I know that both loops work the same way.<br>
I mean which one is more correct?</p>