Easy learning with example program codes

JavaScript handler

Javascript facilitates a number of handler methods in order to improve the ease of programming. These are:

apply() method:
Use: To trap for a function call.

construct() method:
Use: To intercept the new operation.

defineProperty() method:
Use: To define the new properties and to modify the existing properties.

deleteProperty() method:
Use: To remove a property entirely from the target object.

get() method:
Use: To trap for getting a property value.

getOwnPropertyDescriptor() method:
Use: To trap for Object.getOwnPropertyDescriptor().

getPrototypeOf() method:
Use: To trap for the internal method.

has() method:
Use: To hide the specified property.

isExtensible() method:
Use: To trap for Object.isExtensible().

ownKeys() method:
Use: To get an enum object.

preventExtensions() method:
Use: To trap the Object.preventExtensions method.

set() method:
Use: To create a collection of unique items.

setPrototypeOf() method:
Use: To modify the prototype of an object.

Please follow and like us:

Copyright © 2020 CodesJava Protection Status