InterviewHubPRO
Section Overview
Q266

Question 266 of 521

Part 5: ES6+ Modern Syntax, Classes, Modules & Destructuring (254 - 328)

51%
JavaScript Internals (521 Qs)•Part 5: ES6+ Modern Syntax, Classes, Modules & Destructuring (254 - 328)

How do you check whether an object can be extended or not

The Object.isExtensible() method is used to determine if an object is extendable or not. i.e, Whether it can have new properties added to it or not.

javascript
  const newObject = {};
  console.log(Object.isExtensible(newObject)); //true

Note: By default, all the objects are extendable. i.e, The new properties can be added or modified.