javascript function scope and overwriting
<p>I have some javascript like this:</p>

<pre><code>&lt;script&gt; 

var num = 0;

 if(num==0){
    function lol(){
        alert("lol");
    }
 } else {
    function lol(){
        alert("haha");
    }
 }

&lt;/script&gt;
</code></pre>

<p>Then, later in the page I have:</p>

<pre><code>&lt;script&gt;lol();&lt;/script&gt;
</code></pre>

<p>How do I ensure that the first function isn't always overwritten by the second in the else statement?</p>

<p>Thanks</p>
