To remove a property from an object (mutating the object), you can do it by using the delete keyword, like this:

delete myObject.regex;
// or,
delete myObject['regex'];
// or,
var prop = "regex";
delete myObject[prop];

Demo

var myObject = {
  "ircEvent": "PRIVMSG",
  "method": "newURI",
  "regex": "^http://.*"
};
delete myObject.regex;

console.log(myObject);

For anyone interested in reading more about it, Stack Overflow user kangax has written an incredibly in-depth blog post about the delete statement on their blog, Understanding delete. It is highly recommended.

If you'd like a new object with all the keys of the original except some, you could use destructuring.

Demo

let myObject = {
  "ircEvent": "PRIVMSG",
  "method": "newURI",
  "regex": "^http://.*"
};

// assign the key regex to the variable _ indicating it will be unused
const { regex: _, ...newObj } = myObject;

console.log(newObj);   // has no 'regex' key
console.log(myObject); // remains unchanged

Answer from nickf on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Operators › delete
delete - JavaScript - MDN Web Docs - Mozilla
The delete operator removes a property from an object. If the property's value is an object and there are no more references to the object, the object held by that property is eventually released automatically.
Top answer
1 of 16
10001

To remove a property from an object (mutating the object), you can do it by using the delete keyword, like this:

delete myObject.regex;
// or,
delete myObject['regex'];
// or,
var prop = "regex";
delete myObject[prop];

Demo

var myObject = {
  "ircEvent": "PRIVMSG",
  "method": "newURI",
  "regex": "^http://.*"
};
delete myObject.regex;

console.log(myObject);

For anyone interested in reading more about it, Stack Overflow user kangax has written an incredibly in-depth blog post about the delete statement on their blog, Understanding delete. It is highly recommended.

If you'd like a new object with all the keys of the original except some, you could use destructuring.

Demo

let myObject = {
  "ircEvent": "PRIVMSG",
  "method": "newURI",
  "regex": "^http://.*"
};

// assign the key regex to the variable _ indicating it will be unused
const { regex: _, ...newObj } = myObject;

console.log(newObj);   // has no 'regex' key
console.log(myObject); // remains unchanged

2 of 16
1130

Objects in JavaScript can be thought of as maps between keys and values. The delete operator is used to remove these keys, more commonly known as object properties, one at a time.

var obj = {
  myProperty: 1    
}
console.log(obj.hasOwnProperty('myProperty')) // true
delete obj.myProperty
console.log(obj.hasOwnProperty('myProperty')) // false

The delete operator does not directly free memory, and it differs from simply assigning the value of null or undefined to a property, in that the property itself is removed from the object. Note that if the value of a deleted property was a reference type (an object), and another part of your program still holds a reference to that object, then that object will, of course, not be garbage collected until all references to it have disappeared.

delete will only work on properties whose descriptor marks them as configurable.

Discussions

How to remove item from a JavaScript object - Stack Overflow
How can I remove an item from a JavaScript object? More on stackoverflow.com
🌐 stackoverflow.com
Why is removing a specific element from an array so needlessly complicated in Javascript?
I mean the easy answer is: array.splice(array.indexOf("element"), 1); But there's a lot of things that cannot be added to JavaScript due to naming reasons and backwards compatibility. In the early days of JavaScript, it was the wild west. People made and used libraries that did awful things. Notably they extended prototypes. So there's a ton of code floating around for Array.prototype.remove implementations. If a real implementation was added, then these libraries might break in some way. You can see a discussion on this exact method here . This is not the only occurrence of this. Take a look at smooshgate for the most famous example of this. More on reddit.com
🌐 r/learnprogramming
9
0
January 17, 2023
Remove outer object in array of objects
You can't have a key:value pair as an array in javascript. You have to use an object for what you are describing. More on reddit.com
🌐 r/learnjavascript
3
3
October 15, 2021
Best way to remove a nested object property without mutation?
In order to create a copy that is not just references to the original data, you need to make a deep copy rather than a shallow copy. You can do that like this: const myObj = { top1: 'some value', top2: { nested1: 'some value', nested2: 'remove this' } }; console.log(myObj); let myObjCopy = JSON.parse(JSON.stringify(myObj)); delete myObjCopy.top2.nested2; console.log(myObjCopy); The JSON.parse... creates a deep copy, then you just need to delete the desired nested property with the "delete" keyword. And you can see in each of the console.logs that each object is different from one another. oh yeah... and happy cake Day! More on reddit.com
🌐 r/learnjavascript
7
2
February 5, 2021
🌐
W3Schools
w3schools.com › howto › howto_js_remove_property_object.asp
How To Remove a Property from a JavaScript Object
The delete operator is designed to be used on object properties. It has no effect on variables or functions. Note: The delete operator should not be used on predefined JavaScript object properties.
🌐
CoreUI
coreui.io › blog › how-to-remove-a-property-from-an-object-in-javascript
How to remove a property from an object in Javascript · CoreUI
August 28, 2024 - We’ll also cover how to remove multiple properties from a single object efficiently. ... The most direct way to remove a property from a JavaScript object is by using the delete operator.
🌐
freeCodeCamp
freecodecamp.org › news › how-to-remove-a-property-from-a-javascript-object
How to Remove a Property from a JavaScript Object
April 21, 2022 - The operator deletes the corresponding property from the object. let blog = {name: 'Wisdom Geek', author: 'Saransh Kataria'}; const propToBeDeleted = 'author'; delete blog[propToBeDeleted]; console.log(blog); // {name: 'Wisdom Geek'} The delete operation modifies the original object. This means that it is a mutable operation. Using the object restructuring and rest syntax, we can destructure the object with the property to be removed and create a new copy of it.
🌐
Webmaster World
webmasterworld.com › javascript › 3099612.htm
Remove Element From Object, not Array - JavaScript and AJAX forum at WebmasterWorld - WebmasterWorld
var theObject = new Object; theObject = { "test_1" : "to", "test_2" : "the", "test_3" : "moon", "test_4" : "alice" }; function Cart(){ this.items = theObject; this.remove = function(index){ delete this.items.index; // only deletes the dot notation //delete this.items[index]; // deletes both notations document.write(this.items.index+'<br>'); document.write(this.items[index]+'<br>'); } } cart = new Cart(); cart.remove('test_4');
Find elsewhere
🌐
Medium
isantoshv.medium.com › deleting-a-property-from-a-javascript-object-without-mutation-67b9e2d40b7a
Deleting a property from a Javascript Object without Mutation | by Santosh Viswanatham | Medium
July 18, 2021 - The object might have correct value somewhere but will be different at other place and we would have no idea what changed what. So it is highly recommended to perform CRUD operations on Javascript objects without mutating the objects.
🌐
Dmitri Pavlutin
dmitripavlutin.com › remove-object-property-javascript
2 Ways to Remove a Property from an Object in JavaScript
August 17, 2021 - delete is a special operator in JavaScript that removes a property from an object.
🌐
GeeksforGeeks
geeksforgeeks.org › how-to-remove-a-property-from-javascript-object
How to Remove a Property From JavaScript Object? | GeeksforGeeks
October 24, 2024 - The delete operator is used to remove a property from a JavaScript object. The delete operator allows you to remove a specified property from an object.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-remove-an-entry-by-key-in-javascript-object
Remove an Entry by Key in a JavaScript Object - GeeksforGeeks
August 24, 2026 - The Object.keys() method returns an array containing the object's property names. The filter() method can then be used to exclude the key that should be removed.
🌐
Flavio Copes
flaviocopes.com › home › javascript › how to remove a property from a javascript object
How to remove a property from a JavaScript object
May 22, 2018 - The semantically correct way to remove a property from an object is to use the delete keyword. ... If you need to perform this operation in a very optimized way, for example when you’re operating on a large number of objects in loops, another ...
🌐
Sentry
sentry.io › sentry answers › javascript › removing properties from objects in javascript
JavaScript: How to Remove Properties from an Object | Sentry
You can use the delete operator, which is simpler, or object destructuring, which can remove more than a single property at a time. Use the delete operator to remove a property from an object.
🌐
Ultimate Courses
ultimatecourses.com › blog › remove-object-properties-destructuring
Removing Object Properties with Destructuring - Ultimate Courses
Before destructuring, we would typically use the delete keyword to remove properties from an object. The issue with delete is that it’s a mutable operation, physically changing the object and potentially causing unwanted side-effects due to ...
🌐
Qirolab
qirolab.com › questions › how-to-remove-a-property-from-a-javascript-object
How to remove a property from a JavaScript object? | Qirolab
You can use delete keyword to remove properties from objects. if(myObject.hasOwnProperty('item1')) { delete myObject.item1; } Note that, To remove an element from an array, use Array.splice or Array.pop.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › remove-array-element-based-on-object-property-in-javascript
Remove Array Element Based on Object Property in JavaScript - GeeksforGeeks
July 23, 2025 - The code removes an object with id = 2 from the array using the reduce() method. It iterates through the array, pushing only the objects that don’t match the specified id into a new array, which becomes the updated arr. The findIndex() method is used to locate the index of the element that matches the specific property value.
🌐
DEV Community
dev.to › saranshk › how-to-remove-a-property-from-a-javascript-object-4gg
How to Remove a Property from a JavaScript Object - DEV Community
April 21, 2022 - delete is a JavaScript instruction that allows us to remove a property from a JavaScript object.
🌐
Smashing Magazine
smashingmagazine.com › 2023 › 10 › removing-object-properties-javascript
What Removing Object Properties Tells Us About JavaScript — Smashing Magazine
October 23, 2023 - The delete operator’s sole purpose is to remove a property from an object, returning true if the element is successfully removed.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › API › Element › remove
Element: remove() method - Web APIs | MDN
The Element.remove() method removes the element from its parent node. If it has no parent node, calling remove() does nothing.