Returns the Function object being executed, that is, the body text of the specified Function object.
[function.]arguments.callee |
Arguments
- function
-
Optional. The name of the currently executing Function object.
Remarks
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.
Note |
---|
The arguments object is not available when running in fast mode, the default for JScript. To compile a program from the command line that uses the arguments object, 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. |
Example
The following example illustrates the use of the callee property.
В | Copy Code |
---|---|
function factorial(n) { if (n <= 0) return 1; else return n * arguments.callee(n - 1) } print(factorial(3)); |
After compiling this program with the /fast- option, the output of this program is:
В | Copy Code |
---|---|
6 |