Limited supportAvoid in modern code. Explicit parameters and stack-aware tooling are better choices.

Overview

Function.caller and Function.arguments are legacy introspection features that expose call-chain details. Modern JavaScript avoids these patterns because they are brittle and restricted in strict mode.

Browser support

Feature Desktop Mobile
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
1
12
1
1
18
1
Built-in object
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
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)

Syntax

JAVASCRIPT
// Function caller and arguments example
// See MDN Web Docs for details

Live demo

Inspect caller relationships

Read which function invoked another function in a legacy pattern.

JavaScript
Output
Press the Run button

Inspect function arguments length

Read the old function arguments object directly from inside the function.

JavaScript
Output
Press the Run button

Compare legacy and rest parameters

Show the older arguments object next to a modern rest parameter version.

JavaScript
Output
Press the Run button

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.

Powered by web-features