Mar 4, 2010

arguments.callee

var sum = function(i)
{
  if (i == 1)
  {
    return i; 
  }
  else 
  {
    
   return i + arguments.callee(i-1); 
  }
}
alert(sum(3));
​