JavaScript Scope Query?
<pre><code>var my_var = 3;

function doIt() {

    console.log( my_var ); //why undefined?

    var my_var = 7;

    return ++my_var; 
} 

doIt(); // returns 8 as expected 
</code></pre>

<p>Why my_var returns <em>undefined</em> instead global value (3)?</p>
