Home JavaScript Object Methods isSealed() JavaScript Object.isSealed() Method 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.
Call What 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 Object.isSealed(o: object): boolean Parameters Parameter Description obj Required. The value to test. Non-objects are treated as sealed.
Return Value Return Value Description boolean true if the object is sealed; otherwise false.
JavaScript Examples Basic check Seal vs prevent Frozen is sealed Seal an Object and Check Compare a normal object with one that was sealed.
var settings = { theme: "dark" };
console.log(Object.isSealed(settings));
Object.seal(settings);
console.log(Object.isSealed(settings));
settings.theme = "light";
console.log(settings.theme); How It Works Not sealed yet. A fresh object returns false from isSealed.Seal locks the shape. After Object.seal, you cannot add or remove keys.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.
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)); How It Works Only no-add. preventExtensions stops new keys, but isSealed is still false here.Seal is stronger. After seal, isSealed becomes true.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.
var point = { x: 1, y: 2 };
Object.freeze(point);
console.log(Object.isFrozen(point));
console.log(Object.isSealed(point));
console.log(Object.isExtensible(point)); How It Works Freeze first. Object.freeze locks keys and values.Sealed too. isSealed returns true because freeze includes sealing.Not extensible. You also cannot add new properties on a frozen object.Compatibility
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 What does Object.isSealed() mean? It returns true when you cannot add or remove properties on the object. Existing writable values may still change.
Is a frozen object sealed? Yes. Every frozen object is sealed and non-extensible.
Does seal stop changing values? No. Seal only locks the set of keys. To stop value changes, use Object.freeze().
How is seal different from preventExtensions? preventExtensions only blocks new properties. seal also makes existing properties non-configurable so they cannot be deleted or reconfigured.
Can I unseal an object later? No. Sealing cannot be undone. Make a new object if you need a mutable copy.
About the author Developer, cloud engineer, and technical writer
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
Helpful Share Copy link Suggestion