How do you check whether an object can be extendable 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.
1 2 3 4 | const newObject = {}; // It will print true console.log(Object.isExtensible(newObject)); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.