Exploring JavaScript Object Properties in Javascript


Add, modify, and delete object properties.

Source Code

let person = {name: 'John'};
person.age = 30; // Add a new property
person.name = 'Jane'; // Modify an existing property
delete person.age; // Delete a property
console.log(person); // {name: "Jane"}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments