JavaScript Object.isExtensible() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Object

Definition

Object.isExtensible(obj) returns true when you can still add new own properties to obj. Ordinary objects start as extensible.

After Object.preventExtensions(), Object.seal(), or Object.freeze(), the object is no longer extensible, so this method returns false.

Syntax

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

JavaScript
Object.isExtensible(obj)
CallWhat it does
Object.isExtensible(obj)Returns true if new own properties may be added to obj.

Built into JavaScript. Call on Object — no import required.

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

Parameters

ParameterDescription
objRequired. The object to test. In modern engines, non-objects return false without throwing.

Return Value

Return ValueDescription
booleantrue if the object is extensible; false if extensions are prevented (or the value is not an object).

JavaScript Examples

Example 1 — Basic Use

Normal objects are extensible until you lock them down.

JavaScript
var user = { name: "Ada" };
console.log(Object.isExtensible(user));

user.age = 36;
console.log(user.age);
console.log(Object.isExtensible(user));
Try It Yourself

How It Works

  1. Default is open A fresh object literal is extensible, so isExtensible returns true.
  2. Add a property Because it is extensible, assigning user.age works.
  3. Still extensible Adding properties does not change the extensible flag by itself.

Example 2 — preventExtensions

Block new properties and confirm with isExtensible.

JavaScript
var box = { n: 1 };
Object.preventExtensions(box);

console.log(Object.isExtensible(box));
box.n = 2;
box.extra = 3;
console.log(box.n);
console.log(box.extra);
Try It Yourself

How It Works

  1. Lock extensions Object.preventExtensions(box) stops new own keys from being added.
  2. Flag flips Object.isExtensible(box) now returns false.
  3. Existing keys still change Updating box.n works; adding extra fails silently in non-strict mode.

Example 3 — seal and freeze

Sealed and frozen objects are also non-extensible.

JavaScript
var a = { x: 1 };
var b = { y: 2 };
Object.seal(a);
Object.freeze(b);

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

How It Works

  1. seal blocks new keys Object.seal marks the object non-extensible and makes existing keys non-configurable.
  2. freeze is stricter Object.freeze also makes data properties non-writable.
  3. Both fail isExtensible Either way, Object.isExtensible returns false.

Browser & Runtime Support

Object.isExtensible() has been available since ES5. It is Baseline and safe for all modern environments.

✓ Baseline · ES5

Object.isExtensible()

Supported in all modern browsers and Node.js alongside preventExtensions, seal, and freeze.

99% 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.isExtensible Excellent

Bottom line: Use with preventExtensions, seal, and freeze to reason about object mutability.

Frequently Asked Questions

It returns true if new own properties can still be added to the object, and false after preventExtensions, seal, or freeze.
No. Both seal and freeze make an object non-extensible, so isExtensible returns false.
Often yes. preventExtensions only blocks new properties. seal and freeze add more restrictions on existing keys.
No. It only reports whether that object itself can gain new own properties.
In modern JavaScript, Object.isExtensible on a non-object returns false. It does not throw.

Next: isFrozen()

Check whether an object is fully frozen.

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