arguments.callee

  • Revision slug: JavaScript/Reference/Functions_and_function_scope/arguments/callee
  • Revision title: callee
  • Revision id: 34111
  • Created:
  • Creator: Prodoc
  • Is current revision? No
  • Comment wrongfully designated as deprecated

Revision Content

Summary

Specifies the function body of the currently executing function.

Property of arguments local variable; Function (Deprecated)
Implemented in: JavaScript 1.2

JavaScript 1.4: Deprecated callee as a property of Function.arguments, retained it as a property of a function's local arguments variable.

ECMA Version: ECMA-262

Description

arguments.callee is a property of the arguments local variable available within all function objects; arguments.callee as a property of Function is no longer used.

The callee property is available only within the body of a function.

The this keyword does not refer to the currently executing function. Use the callee property to refer to a function within the function body.

Examples

Example: Using arguments.callee

The following function returns the value of the function's callee property.

function myFunc() {
   return arguments.callee
}

The following value is returned:

function myFunc() { return arguments.callee; }

See Also

Function.arguments

Revision Source

<p>
</p>
<h3 name="Summary"> Summary </h3>
<p>Specifies the function body of the currently executing function.
</p>
<table class="fullwidth-table">
<tbody><tr>
<td class="header" colspan="2">Property of <a href="en/Core_JavaScript_1.5_Reference/Objects/Function/arguments">arguments</a> local variable; <a href="en/Core_JavaScript_1.5_Reference/Objects/Function">Function</a> (Deprecated)</td>
</tr>
<tr>
<td>Implemented in:</td>
<td>JavaScript 1.2
<p>JavaScript 1.4: Deprecated <code>callee</code> as a property of <code>Function.arguments</code>, retained it as a property of a function's local <code>arguments</code> variable.
</p>
</td>
</tr>
<tr>
<td>ECMA Version:</td>
<td>ECMA-262</td>
</tr>
</tbody></table>
<h3 name="Description"> Description </h3>
<p><code>arguments.callee</code> is a property of the <code><a href="en/Core_JavaScript_1.5_Reference/Objects/Function/arguments">arguments</a></code> local variable available within all function objects; <code>arguments.callee</code> as a property of <code><a href="en/Core_JavaScript_1.5_Reference/Objects/Function">Function</a></code> is no longer used.
</p><p>The <code>callee</code> property is available only within the body of a function.
</p><p>The <code>this</code> keyword does not refer to the currently executing function. Use the <code>callee</code> property to refer to a function within the function body.
</p>
<h3 name="Examples"> Examples </h3>
<h4 name="Example:_Using_arguments.callee"> Example: Using <code>arguments.callee</code> </h4>
<p>The following function returns the value of the function's <code>callee</code> property.
</p>
<pre>function myFunc() {
   return arguments.callee
}
</pre>
<p>The following value is returned:
</p>
<pre>function myFunc() { return arguments.callee; }
</pre>
<h3 name="See_Also"> See Also </h3>
<p><a href="en/Core_JavaScript_1.5_Reference/Objects/Function/arguments">Function.arguments</a>
</p>
Revert to this revision