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

Create a free account to save this page, take notes and track your progress. Sign in

Syntax

Object.isFrozen(obj)

Parameters

ParameterDescription
obj The object to inspect or change.

Return value

true or false.

Examples

Frozen or notTry it yourself
const a = Object.freeze({ x: 1 });
console.log(Object.isFrozen(a), Object.isFrozen({ x: 1 }));

Output

true false
Primitives and empty non-extensible objects count as frozenTry it yourself
console.log(Object.isFrozen("text"), Object.isFrozen(Object.preventExtensions({})));

Output

true true

Version history

VersionChange
JavaScript ES5Added

Was this page helpful?