JavaScript apply() method

The Javascript handler applies () method traps for a function call.


apply: function(target, thisArg, arguments)

Parameters: target: It represents the target object. thisArg: It represents this keyword for the function call. argumentsList: The list of function parameters.

Return: Any value.


<!DOCTYPE html>
var handler = function(a, b)
document.writeln('proxy: ' + a + ', ' + b);
var proxy = new Proxy(handler, {
apply: function(target, thisArg, parameters)
return target.apply(thisArg, parameters);
proxy('400', '540');
Please follow and like us:
Content Protection by