Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2016.
The handler.apply() method is a trap for the [[Call]] object internal method, which is used by operations such as function calls.
The following parameters are passed to the apply() method. this is bound to the handler.
targetThe target callable object.
thisArgThe this argument for the call.
argumentsListAn Array containing the arguments passed to the function.
The apply() method can return any value, representing the return value of the function call.
This trap can intercept these operations:
Or any other operation that invokes the [[Call]] internal method.
The proxy's [[Call]] internal method throws a TypeError if the handler definition violates one of the following invariants:
The following code traps a function call.
| ECMAScript® 2027 Language Specification # sec-proxy-object-internal-methods-and-internal-slots-call-thisargument-argumentslist |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jul 20, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.