Skip to main content
InterviewHubPRO
Section Overview
Q266

Question 266 of 536

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

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

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

mid LevelCode ExamplejavascriptES6+ Modern Syntax

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.