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:

Chrome49
Edge12
Firefox42
Opera36

Example 1

Output:

1,2,3,,5

Example 2

Output:

false 

Example 3

Output:

 true true true




Latest Courses