Deleting Properties from Objects in Javascript


Remove properties from an object using the delete keyword.

Source Code

let person = {name: "John", age: 30};
delete person.age;
console.log(person); // {name: "John"}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments