Prevent adding or removing properties from an object, but allow modification of existing properties.
Source Code
let obj = { name: 'John' };
Object.seal(obj);
obj.age = 30; // Cannot add new properties
console.log(obj);
Prevent adding or removing properties from an object, but allow modification of existing properties.
let obj = { name: 'John' };
Object.seal(obj);
obj.age = 30; // Cannot add new properties
console.log(obj);