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

Chrome49
Edge12
Firefox18
Opera36

Example 1

Test it Now

Output:

Java Script proxy Constructor

Example 2

Test it Now

Output:

{ "Value": "Hello to anybody" } 

Example 3

Test it Now

Output:

Constructor called Proxi





Latest Courses