Skip to main content
Version: 3.13.0

handler.deleteProperty()

The handler.deleteProperty() method is a trap for the delete operator.

Syntax

new Proxy(target, {
deleteProperty(target, property) {
}
});

Parameters

The following parameters are passed to the deleteProperty() method. this is bound to the handler.

  • target
    • : The target object.
  • property
    • : The name or Symbol of the property to delete.

Return value

The deleteProperty() method must return a Boolean indicating whether or not the property has been successfully deleted.

Description

The handler.deleteProperty() method is a trap for the delete operator.

Interceptions

This trap can intercept these operations:

Or any other operation that invokes the [[Delete]] internal method.

Invariants

If the following invariants are violated, the trap throws a TypeError when invoked.

  • A property cannot be deleted, if it exists as a non-configurable own property of the target object.