JavaScript delete Operator
The delete operator removes a property from an object.
Description
The delete operator removes a property from an object and returns true if it succeeded (or the property didn't exist). It can't delete variables, and in strict mode deleting a non-configurable property, such as one on a frozen object, throws a TypeError.
Using delete on an array element leaves an empty slot rather than shifting elements; use splice() to remove elements. For collections that change often, a Map with its delete() method is usually faster.
delete only removes the object's own property; if the prototype has a property with the same name, it becomes visible again. It returns true even when the property didn't exist, so the return value is rarely useful. Deleting properties can make some engines treat an object as a "dictionary", which may slow down property access, so for frequently changing data a Map is usually a better fit.
Properties
- Operator
delete- Category
- Unary
- Precedence
- 14 (1 is lowest, 18 is highest)
- Associativity
- right-to-left
Syntax
delete object.property
delete object[key]Example
Browser Support
The following information will show you the current browser support for the delete operator. Hover over a browser icon to see the version that first introduced support for this operator.
Desktop





Tablets & Mobile





