Proxy apply()
Triggered when a function is called:
Example
apply(func, thisArg, args) {
return Reflect.apply(func, this, args);
}
Triggered by:
proxy()
proxy.call()
proxy.apply()
Parameters>
- func - the callable object (function)
- this - the this argument for the call
- args - the function arguments array
Must Return
- The return value of the function
Proxy Handler Methods:
handler.apply()
handler.construct()
handler.defineProperty()
handler.deleteProperty()
handler.get()
handler.getOwnPropertyDescriptor()
handler.getPrototypeOf()
handler.has()
handler.isExtensible()
handler.ownKeys()
handler.preventExtensions()
handler.set()
handler.setPrototypeOf()
Browser Support
handler.apply() is an ECMAScript6 (ES6 2015) feature.
JavaScript 2015 is supported in all browsers since June 2017:
| Chrome 51 |
Edge 15 |
Firefox 54 |
Safari 10 |
Opera 38 |
| May 2016 | Apr 2017 | Jun 2017 | Sep 2016 | Jun 2016 |