Reflect.setPrototypeOf() JavaScript

The JavaScript Reflect.setPrototypeOf() method sets the prototype of an object to another object. It is similar to Object.setPrototypeOf(). Syntax: Reflect.setPrototypeOf(target, prototype) Parameters: target: It represents the object whose prototype has to be set. prototype: It represents the object’s new prototype. Return: It returns true if the object’s new prototype is set successfully otherwise, it returns … Read more

Reflect.set() JavaScript JS

The JavaScript Reflect.set() method sets the value of the property of an object. Syntax: Reflect.set(target, propertyKey, value[, receiver]) Parameters: target: It represents the object on which to set the property. propertyKey: It represents the name of the property to set. value: It represents the value of the set corresponding to the specified property. receiver: It … Read more

Reflect.preventExtensions() JavaScript

The JavaScript Reflect.preventExtensions() method prevents any future extensions to an object i.e. prevents addition and modification of properties. It is It is similar to Object.preventExtensions(). Syntax: Reflect.preventExtensions(target) Parameters: target: It represents the object that prevents extensions. Return: It returns true if the target object was successfully set to prevent extensions otherwise returns false. Note: It … Read more

Reflect.ownKeys() JavaScript JS

The JavaScript Reflect.ownKeys() method gives an array whose values represent the keys of the properties of an object. It includes only the object’s direct properties. Syntax: Reflect.ownKeys(target) Parameters: target: It represents the object from which to get the own keys. Return: It returns an array of the target object’s own property keys. Note: It throws … Read more

Reflect.isExtensible() JavaScript

The JavaScript Reflect.isExtensible() method determines if an object is extensible or not. It is similar to Object.isExtensible(). Syntax: Reflect.isExtensible(obj) Parameters: target: It represents the object which to check if it is extensible. Return: It returns true if the object is extensible otherwise returns false. Note: It throws TypeError, if the target is not an Object. … Read more

Reflect.has() JavaScript

The JavaScript Reflect.has() method determines if a property exists in an object. It is similar to in operator as a function. Syntax: Reflect.has(target, propertyKey) Parameters: target: It represents the object on which the property existing checks have to be performed. propertyKey: It represents the name of the property to check. Return: It returns true if … Read more

Reflect.getPrototypeOf() JavaScript JS

The JavaScript Reflect.getPrototypeOf() method gives the prototype of an object. It is similar to the Object.getPrototypeOf(). Syntax: Reflect.getPrototypeOf(target) Parameters: target: It represents the object whose prototype has to be obtained. Return: Prototype of the specified object. Note: It will throw a TypeError if the target is not an Object. Example 1: <!DOCTYPE html> <html> <body> … Read more

Reflect.getOwnPropertyDescriptor() JavaScript

The JavaScript Reflect.getOwnPropertyDescriptor() method returns the descriptor of the property of an object. It is similar to Object.getOwnPropertyDescriptor(). Syntax: Reflect.getOwnPropertyDescriptor(target, propertyKey) Parameters: target: It represents the object in which to look for the property. propertyKey: It represents the name of the property whose descriptor has to be fetched. Return: It returns the descriptor of the … Read more

Reflect.get() JavaScript JS

The JavaScript Reflect.get() method gives the property of an object as a function. Syntax: Reflect.get(target, propertyKey[, receiver]) Parameters: target: It represents the object whose property have to be get. propertyKey: It represents the name of the property to be get. receiver: It represents the value of this provided for the call to object if a … Read more

Reflect.deleteProperty() JavaScript

The JavaScript Reflect.deleteProperty() method deletes a property of an object. Syntax: Reflect.deleteProperty(target, propertyKey)   Parameters: target: It represents the object whose property have to be deleted. propertyKey: It represents the name of the property to be deleted. Return: It returns true if the specified property is successfully deleted otherwise, it returns false. Example 1: <!DOCTYPE … Read more