Remove a property from JavaScript object

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. This operator deletes both the value of the property and the property itself also after deletion, the property you cannot be used before it is added back again.
let myObject = { "Product": "Product - 1", "Description": "Description - 1", "Price": "Price 1", }; delete myObject.Price; console.log(myObject);
Output:
{ Product: 'Product - 1', Description: 'Description - 1' }

Also, you can use:

delete myObject['Price'];
It is important to note that 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. If the value of a deleted property was a reference type , and another part of your code still holds a reference to that object, then that object will, of course, not be garbage collected until all references to it have disappeared.
Removing Javascript Object Properties with Destructuring

Using object destructuring

Object destructuring is an ECMAScript 6 feature. The destructuring assignment syntax is a JavaScript expression that makes it possible to unpack values from arrays, or properties from objects, into distinct variables.
let myObject = { "Product": "Product - 1", "Description": "Description - 1", "Price": "Price 1", }; const {Price, ...newObj} = myObject; console.log(newObj); // has no 'Price' key console.log("\n myObject Remains unchanged..... \n"); console.log(myObject);
Output:
{ Product: 'Product - 1', Description: 'Description - 1' } myObject Remains unchanged..... { Product: 'Product - 1', Description: 'Description - 1', Price: 'Price 1' }
The parentheses ( ... ) around the assignment statement are required when using object literal destructuring assignment without a declaration.