JavaScript Object.isSealed() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Object

Definition

Object.isSealed(obj) returns true when the object is sealed: you cannot add or remove properties, and every property is non-configurable.

Sealed objects can still change existing writable values. Frozen objects are always sealed. Non-extensible alone is not enough to be sealed.

Syntax

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

JavaScript
Object.isSealed(obj)
CallWhat it does
Object.isSealed(obj)Returns true if obj is sealed, otherwise false.
Object.isSealed(Object.seal({}))Always true after sealing.
Object.isSealed(Object.freeze({}))Also true — every frozen object is sealed.

Pass the object to test. Primitives are treated as sealed.

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

Parameters

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

Return Value

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

JavaScript Examples

Seal an Object and Check

Compare a normal object with one that was sealed.

JavaScript
var settings = { theme: "dark" };

console.log(Object.isSealed(settings));

Object.seal(settings);
console.log(Object.isSealed(settings));
settings.theme = "light";
console.log(settings.theme);
Try It Yourself

How It Works

  1. Not sealed yet. A fresh object returns false from isSealed.
  2. Seal locks the shape. After Object.seal, you cannot add or remove keys.
  3. Values can change. Writable properties like theme can still be updated.

preventExtensions Alone Is Not Sealed

Blocking new keys is not the same as sealing. Sealing also makes properties non-configurable.

JavaScript
var a = { n: 1 };
Object.preventExtensions(a);
console.log(Object.isSealed(a));

var b = { n: 1 };
Object.seal(b);
console.log(Object.isSealed(b));
console.log(Object.isExtensible(b));
Try It Yourself

How It Works

  1. Only no-add. preventExtensions stops new keys, but isSealed is still false here.
  2. Seal is stronger. After seal, isSealed becomes true.
  3. Not extensible. A sealed object is also non-extensible, so isExtensible is false.

A Frozen Object Counts as Sealed

Freeze is the strictest lock. Frozen objects always report sealed.

JavaScript
var point = { x: 1, y: 2 };
Object.freeze(point);

console.log(Object.isFrozen(point));
console.log(Object.isSealed(point));
console.log(Object.isExtensible(point));
Try It Yourself

How It Works

  1. Freeze first. Object.freeze locks keys and values.
  2. Sealed too. isSealed returns true because freeze includes sealing.
  3. Not extensible. You also cannot add new properties on a frozen object.

Browser & Runtime Support

Object.isSealed() is an ES5 feature and is available in all modern browsers and Node.js.

✓ ES5 · Baseline

Object.isSealed()

Works in every current browser and server runtime. Safe without a polyfill today.

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.isSealed Excellent

Bottom line: Use freely. Pair with Object.seal() when you need to lock an object shape but still allow value updates.

Frequently Asked Questions

It returns true when you cannot add or remove properties on the object. Existing writable values may still change.
Yes. Every frozen object is sealed and non-extensible.
No. Seal only locks the set of keys. To stop value changes, use Object.freeze().
preventExtensions only blocks new properties. seal also makes existing properties non-configurable so they cannot be deleted or reconfigured.
No. Sealing cannot be undone. Make a new object if you need a mutable copy.

Next: keys()

List an object’s own enumerable string keys.

keys() 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