Function expression with Arguments
<p>I was playing around with function expressions and trying to get my head round some stuff.This is the code I wrote.</p>

<p>This works</p>

<pre><code>var sum=function(arg1,arg2){
    return(function(){alert(arg1*arg2)})
}

document.getElementById('button_1').onclick=sum(3,2);
</code></pre>

<p>This doesnt,I know it doesnt even look right.But Im just trying to understand the reason behind the error that was being displayed here.It first displayed the alert box with 6 then an error message "Not Implemented",this is in IE6.</p>

<pre><code>var sum=function(arg1,arg2){
    alert(arg1*arg2);
}

document.getElementById('button_1').onclick=sum(3,2);
</code></pre>

<p>If you guys think this question doesn't require an answer please let me know,I will delete it.</p>

<p>Thanks</p>
