Variables defined in global scope with identical names
<p>Can anybody explain, why next js code rises two alert windows with 'string1' text rather than to rise the second with 'undefined' text inside??  If both variables are described in the same scope..</p>

<pre class="lang-js prettyprint-override"><code>var a = 'string1';  
alert(a);  
var a;  
alert(a);​
</code></pre>

<p><a href="http://jsfiddle.net/FdRSZ/1/">http://jsfiddle.net/FdRSZ/1/</a></p>

<p>Thanks</p>
