🔹handler method

🚧 under construction

JSobjectbuilt-inProxy ⟩ handler method

Proxy handler methods intercept invocations of internal method.

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

🈯 synonyms: "proxy trap"

  • object creation

    • construct [[Construct]] - create new objects.

  • property creation/deletion

    • defineProperty [[DefineOwnProperty]] - create/update property.

    • deleteProperty [[Delete]] - delete property.

    • preventExtensions [[PreventExtensions]] - prevent from adding new properties.

    • isExtensible [[IsExtensible]] - check if object is extensible.

  • property access

    • get [[Get]] - get a property.

    • getPrototypeOf [[GetPrototypeOf]] - get object's prototype.

    • set [[Set]] - set a property.

    • setPrototypeOf [[SetPrototypeOf]] - set object's prototype.

  • property testing

    • has [[HasProperty]] - check if property exists.

  • property enumeration

    • ownKeys [[OwnPropertyKeys]] - own property keys.

    • getOwnPropertyDescriptor [[GetOwnProperty]] - get property descriptor.

  • method invocation

    • apply [[Call]] - invoke method/function call.

Last updated