Javascript Scoping Confusion
<p>I couldn't find an exact match on my issue, though many javascript scoping questions do exist. Here is my current code for the question.</p>

<pre><code>var my_var = "blank";
var MyFunc = function() {
    my_var = "one";
    //var my_var = "two";
}
alert(my_var);
MyFunc();
alert(my_var);
</code></pre>

<p>When I run this, I am alerted with <strong>"blank"</strong> and then <strong>"one"</strong> as expected. However, if I uncomment that one line, so it looks like this.</p>

<pre><code>var my_var = "blank";
var MyFunc = function() {
    my_var = "one";
    var my_var = "two";
}
alert(my_var);
MyFunc();
alert(my_var);
</code></pre>

<p>I am alerted with <strong>"blank"</strong> and then <strong>"blank"</strong>. This is not what I would expect and I find it confusing that adding a line will remove behavior. Can anyone explain what is going on here? I am seeing this behavior in both firefox and safari.</p>
