84
JavaScript handler.construct() Method
The handler.construct() method is used to intercept the new operation. This method returns an object.
Syntax
Parameters
Target: The target object.
argumentsList: List of the constructor.
newTarget: The constructor that was originally called, p above.
Return value
This method returns an object.
Browser Support
Chrome | 49 |
Edge | 12 |
Firefox | 18 |
Opera | 36 |
Example 1
Output:
Java Script proxy Constructor
Example 2
Output:
{ "Value": "Hello to anybody" }
Example 3
Output:
Constructor called Proxi
Next TopicJavaScript handler