Export (0) Print
Expand All

callee Property

Returns the Function object being executed, that is, the body text of the specified Function object.

[function.]arguments.callee

function

Optional. The name of the currently executing Function object.

The callee property is a member of the arguments object that becomes available only when the associated function is executing.

The initial value of the callee property is the Function object being executed. This allows anonymous functions to be recursive.

NoteNote

The arguments object is not available when a program is running in fast mode, the default for JScript. To compile a program that uses the arguments object from a command prompt, you must turn off the fast option by using /fast-. It is not safe to turn off the fast option in ASP.NET because of threading issues. For more information, see arguments Object.

The following example illustrates the use of the callee property.

function factorial(n) {
   if (n <= 0)
      return 1;
   else
      return n * arguments.callee(n - 1)
}
print(factorial(4));
// Output: 24

Community Additions

ADD
Show:
© 2014 Microsoft