JavaScript handler.apply() Method

The handler.apply() method is used to trap for a function call. The value returned by the apply trap is also going to be used as the result of a function call through a proxy.

Syntax

Parameters

target: The target object.

thisArg: thisArg use for the call.

argumentsList: The list of arguments used for the call.

Return value

This method can return any value.

Browser Support

Chrome49
Edge12
Firefox18
Opera36

Example 1

Test it Now

Output:

First exam.. 
proxy value(23, 54)

Example 2

Test it Now

Output:

in apply 
in x(direct1, direct2) in apply 
in x(add, add) in apply 
in x(string, string)

Example 3

Test it Now

Output:

56 
68





Latest Courses