Can't understand this behaviour of window implicit object
<p>HTML code:</p>

<pre><code>&lt;html&gt;&lt;body&gt;&lt;pre&gt;&lt;script src="pippo.js"&gt;&lt;/script&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;  
</code></pre>

<p>Javascript Code (file "pippo.js"):</p>

<pre><code>document.writeln("start");
var f1 = function(){
    document.writeln('Hello, world! f1');
}

var f2 = function(){
    document.writeln('Hello, world! f2');
}
(window)
</code></pre>

<p>Output int the browser (i tryed Chrome and FF):</p>

<blockquote>
  <p>Start<br>
  Hello, world! f2  </p>
</blockquote>

<p>Why is last defiend function executed?
if i add <code>a=0</code> f2 is not executed
so it seems to me that the last definition is evalueted
I don't know why.</p>
