arguments.callee
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
Note: Accessing arguments.callee in strict mode will throw a TypeError. If a function must reference itself, either give the function expression a name or use a function declaration.
The arguments.callee data property contains the currently executing function that the arguments belong to.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
javascript.functions.arguments.callee Deprecated | 1 | 12 | 1 | 1 | 18 | 1 |
Syntax
// arguments.callee example
// See MDN Web Docs for details Live demo
Recursive call with arguments.callee
Use the legacy recursive pattern inside a non-strict function expression.
Anonymous function recursion
Show how arguments.callee was used before naming the function directly.
Compare with a named function
Contrast the legacy pattern with the modern named-function approach.
Use cases
-
Legacy recursion fixes
Replace anonymous self-reference patterns in older code with named functions or local bindings.
-
Strict-mode cleanup
Use migration work to remove callee references before modernizing a codebase.
Cautions
- arguments.callee is deprecated and unavailable in strict mode.
- Self-reference should be explicit so stack traces and code reviews stay understandable.
Accessibility
- No direct accessibility behavior, but reducing legacy language features lowers maintenance risk in interactive code.
- Prefer patterns that are easier for teams to debug and stabilize.