---
description: 🚧 under construction
---

# handler method

[JS](../../..) ⟩ [object](../../obj) ⟩ [built-in](..) ⟩ [Proxy]() ⟩ handler method&#x20;

{% hint style="success" %}
**Proxy&#x20;**<mark style="color:yellow;">**handler methods**</mark> intercept invocations of [**internal method**](../../obj/prop/internal).

```javascript
let proxy = new Proxy(target, {
    // hander methods ...
    __proto__: null,        // prevent from inheriting unnecessary methods.
});
```

:u6307: <mark style="color:yellow;">**synonyms**</mark>： "<mark style="color:purple;">**proxy trap**</mark>"
{% endhint %}

{% tabs %}
{% tab title="🔴 主題" %}
* <mark style="color:yellow;">**object creation**</mark>&#x20;
  * construct \[\[Construct]] - create new objects.
* <mark style="color:yellow;">**property creation**</mark>**/**<mark style="color:yellow;">**deletion**</mark>
  * defineProperty \[\[DefineOwnProperty]] - create/update property.
  * deleteProperty \[\[Delete]] - delete property.
  * preventExtensions \[\[PreventExtensions]] - prevent from adding new properties.
  * isExtensible \[\[IsExtensible]] - check if object is extensible.
* <mark style="color:yellow;">**property access**</mark>
  * get \[\[Get]] - get a property.
  * getPrototypeOf \[\[GetPrototypeOf]] - get object's prototype.
  * set \[\[Set]] - set a property.
  * setPrototypeOf \[\[SetPrototypeOf]] - set object's prototype.
* <mark style="color:yellow;">**property testing**</mark>
  * has \[\[HasProperty]] - check if property exists.
* <mark style="color:yellow;">**property enumeration**</mark>
  * ownKeys \[\[OwnPropertyKeys]] - own property keys.
  * getOwnPropertyDescriptor \[\[GetOwnProperty]] - get property descriptor.
* <mark style="color:yellow;">**method invocation**</mark>
  * apply \[\[Call]] - invoke method/function call.
{% endtab %}

{% tab title="👥 相關" %}
* [reflect](reflect "mention") API
{% endtab %}

{% tab title="📗 參考" %}
* [ ] JS.info ⟩ [Proxy and Reflect](https://javascript.info/proxy)
* [ ] [javascript-the-definitive-guide](../../../../master/ref/javascript-the-definitive-guide "mention") ⟩ 14.7 Proxy Objects
{% endtab %}

{% tab title="📘 手冊" %}
* [Object.defineProperty](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty), [Object.defineProperties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperties)
* [Object.isExtensible](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible)
* [Object.preventExtensions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/preventExtensions)
* [Object.getOwnPropertyDescriptor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor)
* [Object.getPrototypeOf](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf), [Object.setPrototypeOf](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf)
* [Object.getOwnPropertyNames](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames), [Object.getOwnPropertySymbols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertySymbols)
{% endtab %}
{% endtabs %}
