javascript function name vs function literal usage
<p>When testing for a partial evaluation function: </p>

<pre><code>function partialEval(fn)
   {
      var sliceMethod = Array.prototype.slice; 
      if(arguments.length &gt; 1)
      {
        var aps = sliceMethod.call(arguments, 1);
      }


      return function () {
         return fn.apply(this,aps.concat(  sliceMethod.call(arguments)  ));  
    };

    }




    var x= function add(a,b,c,d){
     console.debug(a +  " - " +  b +  " - " +  c +  " - " +  d);
     return a+b+c+d; 

    }

    var pa = partialEval(add, 1,2); // Query here
    var zz = pa(3,4);
    console.debug(zz);
</code></pre>

<p>What is the difference between calling partialEval(add,1,2) and partialEval (x,1,2)?
I understand that x is a function literal here  and using x gives the correct results. But when I use add as a function name sent to the partialEval method the output is coming as 3. Can someone explain the execution differences between the two?</p>

<p>thanks.</p>
