The callee Property

In addition to its array elements, the Arguments object defines a callee property that refers to the
function that is currently being executed. This property is rarely useful, but it can be used to allow
unnamed functions to invoke themselves recursively. For instance, here is an unnamed function literal
that computes factorials:

function(x) {
   if (x <= 1) return 1;
   return x * arguments.callee(x-1);
}
 

 

你可能感兴趣的:(property)