Home » JavaScript Reflect deleteProperty() Method

JavaScript Reflect deleteProperty() Method

by Online Tutorials Library

JavaScript Reflect.deleteProperty() Method

The Reflect.deleteProperty() method allows to delete a property on an object. If the method returns true, that means deleting the property is successful. Otherwise, it returns false.

Syntax:

Parameters:

target: It is the target object on which to delete the property.

propertyKey: It is the name of the property to be deleted.

Return value:

A Boolean represents that the property was successfully deleted or not.

Exceptions:

A TypeError, if the target is not an Object.

Browser Support:

Chrome 49
Edge 12
Firefox 42
Opera 36

Example 1

Output:

1,2,3,,5  

Example 2

Output:

false   

Example 3

Output:

 true true true  
Next TopicJavaScript Reflect

You may also like