
Object.seal() – Seals an object: prevents adding/removing properties but allows modification of existing properties.
๐ Syntax
Object.seal(obj)
๐งช Example
const obj = { name: 'Test' };
Object.seal(obj);
obj.name = 'New'; // Allowed
obj.age = 25; // Ignored
Comments
Post a Comment