---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---
# handler.construct()

The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid).

## Syntax

```js
new Proxy(target, {
  construct(target, argumentsList, newTarget) {
  }
});
```

### Parameters

The following parameters are passed to the `construct()` method. `this` is bound to the handler.

- `target`
  - : The target object.
- `argumentsList`
  - : The list of arguments for the constructor.
- `newTarget`
  - : The constructor that was originally called, `p` above.

### Return value

The `construct` method must return an object.

## Description

The **`handler.construct()`** method is a trap for the `new` operator.

### Interceptions

This trap can intercept these operations:

- The `new` operator: `new myFunction(...args)`
- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx)

Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods).

### Invariants

If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked.

- The result must be an `Object`.
