I don't understand the Scope
<p>1 - why when I run the below code I got <strong>undefind</strong> instead <strong>"a=1"</strong> ?</p>

<pre><code>function f1(){a=1; f2();}
function f2(){return a;}
var a= 5;
a = f1();
​alert(a);​
</code></pre>

<p>like this example the resualt is <strong>"a=1"</strong>.</p>

<pre><code>function f1(){a=1; f2();}
function f2(){alert(a);}
var a= 5;
f1();
</code></pre>
