Function caller and arguments
The arguments accessor property of Function instances returns the arguments passed to this function. For strict, arrow, async, and generator functions, accessing the arguments property throws a TypeError.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
Function.arguments Deprecated Non-standard | 1 | 12 | 1 | 1 | 18 | 1 |
Function.caller Deprecated Non-standard The caller accessor property of Function instances returns the function that invoked this function. For strict, arrow, async, and generator functions, accessing the caller property throws a TypeError. | 1 | 12 | 1 | 3 | 18 | 1 |
Live demo
Inspect caller relationships
Read which function invoked another function in a legacy pattern.
Inspect function arguments length
Read the old function arguments object directly from inside the function.
Compare legacy and rest parameters
Show the older arguments object next to a modern rest parameter version.
Use cases
-
Legacy cleanup
Remove caller and arguments dependencies when modernizing older function-heavy code.
-
Historical debugging
Understand why old code relied on runtime call inspection before replacing it with explicit logic.
Cautions
- These features are deprecated and create fragile coupling between functions.
- Code that depends on caller inspection is usually harder to optimize, test, and reason about.
Accessibility
- No direct accessibility effect, but removing brittle runtime tricks improves long-term UI stability.
- Prefer explicit data flow so assistive-technology-critical behavior remains predictable.