JavaScript Object.isFrozen() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Object

Definition

Object.isFrozen(obj) returns true when the object is frozen: you cannot add properties, remove properties, or change existing property values (and property descriptors stay locked).

A frozen object is also non-extensible and sealed. Use Object.freeze() to freeze; use Object.isFrozen() only to check. In non-strict mode failed writes are ignored; in strict mode they throw.

Syntax

Call Object.isFrozen() like this. Start with this line.

JavaScript
Object.isFrozen(obj)
CallWhat it does
Object.isFrozen(obj)Returns true if obj is frozen, otherwise false.
Object.isFrozen(Object.freeze({}))Always true — freeze then check.
Object.isFrozen({})Returns false for a normal, extensible object.

Pass the object you want to test. Primitives are treated as frozen (the check returns true).

Library declarations
JavaScript
Object.isFrozen(obj)
JavaScript
Object.isFrozen(o: object): boolean

Parameters

ParameterDescription
objRequired. The value to test. Non-objects are treated as frozen.

Return Value

Return ValueDescription
booleantrue if the object is frozen; otherwise false.

JavaScript Examples

Check a Normal Object and a Frozen One

Call Object.isFrozen() before and after Object.freeze().

JavaScript
var user = { name: "Ada" };

console.log(Object.isFrozen(user));

Object.freeze(user);
console.log(Object.isFrozen(user));
console.log(user.name);
Try It Yourself

How It Works

  1. Normal object. A plain object is not frozen, so the first check prints false.
  2. Freeze it. Object.freeze(user) locks the object. The second check prints true.
  3. Values stay. Existing data is still readable. Freezing does not delete properties.

Frozen Is Stricter Than Sealed

A sealed object can still change writable values. A frozen object cannot.

JavaScript
var sealed = { score: 10 };
Object.seal(sealed);
sealed.score = 99;
console.log(Object.isFrozen(sealed));
console.log(sealed.score);

var frozen = { score: 10 };
Object.freeze(frozen);
frozen.score = 99;
console.log(Object.isFrozen(frozen));
console.log(frozen.score);
Try It Yourself

How It Works

  1. Seal allows writes. After seal, score can still change if it is writable. isFrozen stays false.
  2. Freeze blocks writes. After freeze, assigning 99 does nothing in non-strict mode. The value stays 10.
  3. Pick the right lock. Use freeze when values must not change. Use seal when keys must stay but values may update.

Freeze Is Shallow

Freezing the outer object does not freeze nested objects inside it.

JavaScript
var box = {
  label: "toys",
  items: { count: 3 }
};

Object.freeze(box);
console.log(Object.isFrozen(box));
console.log(Object.isFrozen(box.items));

box.items.count = 8;
console.log(box.items.count);
Try It Yourself

How It Works

  1. Outer is frozen. Object.isFrozen(box) is true after freeze.
  2. Inner is not. box.items is a separate object, so it is still mutable.
  3. Nested write works. Changing box.items.count succeeds unless you also freeze the nested object.

Browser & Runtime Support

Object.isFrozen() arrived with ES5 and works in all modern browsers and Node.js.

✓ ES5 · Baseline

Object.isFrozen()

Supported everywhere you run modern JavaScript. No polyfill needed for current browsers.

100% Modern browser support
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
Object.isFrozen Excellent

Bottom line: Safe to use in every current browser and runtime. Pair with Object.freeze() when you need immutability checks.

Frequently Asked Questions

It returns true if the object cannot add, remove, or change properties. Otherwise it returns false.
No. It only checks. Call Object.freeze(obj) to freeze, then Object.isFrozen(obj) to verify.
preventExtensions blocks only adding keys. seal also blocks removing keys. freeze also blocks changing values. Frozen implies sealed and non-extensible.
No. Nested objects stay mutable unless you freeze them too.
Non-object values are treated as frozen, so Object.isFrozen(1) returns true.

Next: isSealed()

Check whether an object is sealed.

isSealed() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful