Friday, September 19, 2025
HomeLanguagesJavascriptJavaScript Reflect isExtensible() Method

JavaScript Reflect isExtensible() Method

JavaScript Reflect.isExtensible() method in JavaScript is used to check whether an object is extensible or not(Checks whether other properties can be added to it or not). This method is similar to Object.isExtensible() but it will cause a TypeError if the target is not an object.

Syntax:

Reflect.isExtensible( obj )

Parameters: This method accepts a single parameter as mentioned above and described below:

  • Obj: This parameter is the target object and is used to check whether it is extensible.

Return value: This method returns a Boolean value which indicates if the target is extensible.

Exceptions: A TypeError is an exception given as the result when the target is not an Object.

Below examples illustrate the Reflect.isExtensible() method in JavaScript:

Example 1: In this example, we will check if the object is extensible or not using the isExtensible() method in JavaScript.

javascript




const object1 = {};
 
console.log(Reflect.isExtensible(object1));
Reflect.preventExtensions(object1);
console.log(Reflect.isExtensible(object1));
 
const object2 = Object.seal({});
console.log(Reflect.isExtensible(object2));
 
const object3 = Object.seal({});
console.log(Reflect.isExtensible(object3));


Output

true
false
false
false

Example 2: In this example, we will check if the object is extensible or not using the isExtensible() method in JavaScript.

javascript




// Sealed objects are by definition
// non-extensible.
let sealed = Object.seal({})
console.log(Reflect.isExtensible(sealed));
 
let empty = {}
console.log(Reflect.isExtensible(empty));
 
// ...but that can be changed.
Reflect.preventExtensions(empty)
console.log(Reflect.isExtensible(empty));
 
// Frozen objects are also by
// definition non-extensible.
let frozen = Object.freeze({})
console.log(Reflect.isExtensible(frozen));


Output

false
true
false
false

Supported Browsers:

The browsers are supported by JavaScript Reflect.construct() Methods are listed below:

  • Google Chrome 49 and above
  • Edge 12 and above
  • Firefox 42 and above
  • Opera 36 and above
  • Safari 10 and above

We have a complete list of Javascript Reflects methods, to check those go through the JavaScript Reflect Reference article.

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
RELATED ARTICLES

Most Popular

Dominic
32301 POSTS0 COMMENTS
Milvus
84 POSTS0 COMMENTS
Nango Kala
6666 POSTS0 COMMENTS
Nicole Veronica
11840 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11898 POSTS0 COMMENTS
Shaida Kate Naidoo
6781 POSTS0 COMMENTS
Ted Musemwa
7056 POSTS0 COMMENTS
Thapelo Manthata
6739 POSTS0 COMMENTS
Umr Jansen
6744 POSTS0 COMMENTS