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