JavaScript (ES2026) reference · Object Methods
JavaScript Object.isSealed() Method
Return true if an object is sealed: properties can't be added or removed, but existing ones may still change.
JavaScript (ES2026) Since ES5
Syntax
Object.isSealed(obj)
Parameters
| Parameter | Description |
|---|---|
obj |
The object to inspect or change. |
Return value
true or false.
Examples
const s = Object.seal({ x: 1 });
console.log(Object.isSealed(s), Object.isFrozen(s));
Output
true false
console.log(Object.isSealed(Object.freeze({ y: 2 })));
Output
true
Version history
| Version | Change |
|---|---|
| JavaScript ES5 | Added |
Related
Object.seal()· Prevent adding or removing properties while still allowing existing properties to be changed.Object.isFrozen()· Return true if an object is frozen: no properties can be added, removed or changed.- JavaScript Objects · tutorial