The delete operator allows you to remove a property from an object.

The following examples all do the same thing.

// Example 1
var key = "Cow";
delete thisIsObject[key]; 

// Example 2
delete thisIsObject["Cow"];

// Example 3
delete thisIsObject.Cow;

let animals = {
  'Cow': 'Moo',
  'Cat': 'Meow',
  'Dog': 'Bark'
};

delete animals.Cow;
delete animals['Dog'];

console.log(animals);
Run code snippetEdit code snippet Hide Results Copy to answer Expand

If you're interested, read Understanding Delete for an in-depth explanation.

Answer from jessegavin on Stack Overflow
🌐
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.
Discussions

javascript - Remove item from object by key - Stack Overflow
So I created React Todo App with an Object as a Todo List. Removing an item by key works with delete, but brings me back boolean instead of Object with the rest of the items. deleteTodo = (id) =... More on stackoverflow.com
🌐 stackoverflow.com
How to delete a javascript object item by value? - Stack Overflow
Take, for instance, the following object: var fruits = { "red" : "apple", "blue" : "blueberry", "yellow" : "banana" } I know I can use delete fruits["red"] to remove it by the key name... More on stackoverflow.com
🌐 stackoverflow.com
javascript - Remove element by key from all the objects inside an object - Stack Overflow
And then use for...of and delete to remove the path from each object in items: const test = { "/test": { path: "/test", items: [{ path: "/test", method: "GET" }, { path: "/test", method: "PUT" }] }, "/test2": { path: "/test2", items: [{ path: "/test2", method: "GET", }] } }; for (let key in test) { for (let item of test[key].items) { delete item.path } } console.log(test) ... Find the answer to your question by ... More on stackoverflow.com
🌐 stackoverflow.com
How do I remove a property from a JavaScript object? - Stack Overflow
The term you have used in your question title, Remove a property from a JavaScript object, can be interpreted in some different ways. The one is to remove it for whole the memory and the list of object keys or the other is just to remove it from your object. As it has been mentioned in some ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
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.
🌐
Codegive
codegive.com › blog › js_remove_item_from_object_by_key.php
Master JS Remove Item from Object by Key (2024): Delete Properties Like a Pro!
When we talk about "js remove item from object by key," we're referring to the process of taking a JavaScript object and eliminating one or more of its properties (key-value pairs) based on their specific keys. This operation modifies the object's structure, making it a fundamental aspect of ...
🌐
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.
🌐
GeeksforGeeks
geeksforgeeks.org › how-to-remove-an-entry-by-key-in-javascript-object
How to Remove an Entry by Key in JavaScript Object? | GeeksforGeeks
August 13, 2024 - You can create an object in JavaScript in the following ways: By using the object literal notation, which is a comma-separated list of key-valu ... In JavaScript, objects store data in the form of key-value pairs where the key may be any property of the object. In this article let us see how to remove key-value pairs a by given key in the object.Table of ContentUsing the delete operatorUsing the filter() methodUsing Destructuring and Object.ass
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-remove-a-key-from-javascript-object
How to remove a key-value pair from JavaScript object? - GeeksforGeeks
The Underscore.js _.omit() method creates a new object by excluding specified keys from the original object. This approach allows you to remove one or more key-value pairs without mutating the original object, returning a modified copy instead.
Published: July 23, 2025
Find elsewhere
🌐
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 - That is what you want for state you should not mutate, like in React or Redux code. More on properties in JavaScript Object Properties. ... const car = { color: 'blue', brand: 'Ford' } const prop = 'color' const newCar = Object.keys(car).reduce((object, key) => { if (key !== prop) { object[key] = car[key] } return object }, {})
🌐
JavaScript in Plain English
javascript.plainenglish.io › how-to-remove-a-key-from-an-object-in-javascript-9e5cf823fd37
How to Remove a Key from an Object in JavaScript | by Dr. Derek Austin 🥳 | Just JavaScript Tutorials | Medium
February 10, 2026 - “The JavaScript delete operator removes a property from an object; if no more references to the same property are held, it is eventually released automatically.” — MDN Docs · While you might think setting an object key equal to undefined would delete it, since undefined is the value that object keys that have not yet been set have, the key would still exist.
🌐
Stack Abuse
stackabuse.com › javascript-remove-a-property-from-an-object
JavaScript: Remove a Property from an Object
August 25, 2021 - For example, let's remove all properties that have a numeric value: const developer = { name : "Fred", dailyCoffeIntake : 2, favoriteLanguage : "Haskell", age : 27 }; const keysToKeep = Object.keys(developer).filter( (key)=> { return !Number.isInteger(developer[key]) }); const newDeveloper = {}; keysToKeep.forEach((key)=>{ newDeveloper[key] = developer[key] }); console.log(newDeveloper); // {name: "Fred", favoriteLanguage: "Haskell"}
🌐
Scaler
scaler.com › home › topics › how to remove a property from a javascript object?
How to Remove a Property from a JavaScript Object - Scaler Topics
January 6, 2024 - At last, I would like to add that it does not matter whether you use the delete operator or Reflect.deleteProperty() method as both of them do the task in almost same time compexity. But using Object Destructuring consumes more time comparatively. Hence, the delete operator is the most preferred ...
🌐
Javatpoint
javatpoint.com › how-to-remove-a-key-property-from-an-object-in-javascript
How to remove a Key/Property from an object in JavaScript - javatpoint
How to remove a Key/Property from an object in JavaScript with javascript tutorial, introduction, javascript oops, application of javascript, loop, variable, objects, map, typedarray etc.
Top answer
1 of 16
10002

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);
Run code snippetEdit code snippet Hide Results Copy to answer Expand

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
Run code snippetEdit code snippet Hide Results Copy to answer Expand

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
Run code snippetEdit code snippet Hide Results Copy to answer Expand

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.

🌐
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 - Performance Issues: The delete operator can cause performance degradation, especially in performance-critical applications. JavaScript engines optimize objects for speed, but when a property is deleted, it can lead to de-optimization.
🌐
30 Seconds of Code
30secondsofcode.org › home › javascript › object › remove property from object
How do I remove a property from a JavaScript object? - 30 seconds of code
June 12, 2021 - const pet = { species: 'dog', age: 3, name: 'celeste', gender: 'female' }; pet.gender = undefined; Object.keys(pet); // ['species', 'age', 'name', 'gender'] The delete operator is technically the correct way to remove a property from a JavaScript ...