How TO - Remove a Property from an Object
Remove Property from an Object
The delete operator deletes a property from an object:
delete person.age; // or delete person["age"];
// Before deletion: person.age = 50, after deletion, person.age = undefined
The delete operator deletes both the value of the property and the property itself.
After deletion, the property cannot be used before it is added back again.
The delete operator is designed to be used on object properties. It has no effect on variables or functions.