CKTIS / JavaScript
Reflect.isExtensible — checking object extensibility
Reflect.isExtensible(target) checks whether an object is extensible. For an ordinary object, extensibility means that new own properties can be added. The method returns a boolean and throws TypeError for primitive values.
Version: ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
Syntax
Reflect.isExtensible(target)Reflect.isExtensible(target) returns true when an object is extensible, or false when it is not. For an ordinary object, extensibility means that new own properties can be added. The method reads this state; it does not change it itself.
Object.preventExtensions(target) prevents new own properties from being added. Object.seal(target) and Object.freeze(target) also make objects non-extensible, but impose additional restrictions. Therefore, false does not mean that an object is frozen: existing writable properties can still be changed, and configurable properties can still be deleted. An ordinary object cannot be made extensible again.
The argument must be an object; arrays and functions are objects too. Primitive values, including null and undefined, cause a TypeError. This is an important difference from Object.isExtensible(target), which returns false for primitives instead of throwing.
The method invokes the internal [[IsExtensible]] operation. For a Proxy, it can invoke the isExtensible trap, so do not assume it is free of side effects. After boolean conversion, the trap result must match the target object's actual extensibility; otherwise, a TypeError occurs. A revoked proxy also causes a TypeError.
Examples
const item = { count: 1 };
console.log(Reflect.isExtensible(item));
Object.preventExtensions(item);
console.log(Reflect.isExtensible(item));
console.log(Reflect.set(item, "extra", 10));
item.count = 2;
console.log(item.count);
try {
Reflect.isExtensible(42);
} catch (error) {
console.log(error.name);
}Result
true false false 2 TypeError
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.