Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / JavaScript

Reflect.deleteProperty — deleting properties with a boolean result

Reflect.deleteProperty(target, propertyKey) attempts to delete an object's own property and returns a boolean result. For an ordinary object, it returns true even when the property is absent, and false when the property has configurable: false.

Version: ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support

Syntax

Reflect.deleteProperty(target, propertyKey)

Reflect.deleteProperty(target, propertyKey) invokes the object's internal [[Delete]] operation. target must be an object; a primitive value, including null, causes a TypeError. propertyKey is converted to a property key: a string or a Symbol.

For an ordinary object, the method removes an own property if its configurable attribute is true. It then returns true; it also returns true when no own property exists. A property with configurable: false remains unchanged, and the result is false. The method does not delete properties from the prototype: deleting an own property can reveal an inherited property with the same key.

Unlike delete target[propertyKey] in strict mode, the method returns false rather than throwing solely because deletion was refused. This does not mean it never throws: exceptions can arise from key conversion or from a Proxy, whose deleteProperty trap can intercept the operation and is subject to specification invariants.

The example demonstrates deletion, an absent property, and refused deletion in strict mode. This is an ECMAScript standard-library function, not a Web API. The specification alone does not establish support in a particular browser version; the presence of Node 24 in a repository does not establish it either.

Examples

"use strict";
const item = { temporary: 1 };
Object.defineProperty(item, "fixed", {
  value: 2,
  configurable: false
});

console.log(Reflect.deleteProperty(item, "temporary"));
console.log(Reflect.deleteProperty(item, "missing"));
console.log(Reflect.deleteProperty(item, "fixed"));
console.log(Object.prototype.hasOwnProperty.call(item, "temporary"));
console.log(item.fixed);

Result

true
true
false
false
2

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources