JS Coding Questions Logo
JS Coding Questions
#262💼 Interview💻 Code

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

Advertisement

728x90

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
1const newObject = {};
2
3console.log(Object.isExtensible(newObject)); //true

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

Advertisement

Responsive Ad
🎯 Practice NowRelated Challenge

JavaScript Coding Exercise 5

Test your knowledge with this interactive coding challenge.

Start Coding

Advertisement

728x90
262of476
How do you check whether an object can be extended or not | JSCodingQuestions.com