check whether an object can be extendable or not in JavaScript

JavaScript

🤖 Code Explanation

Object.seal(obj);
console.log(Object.isSealed(obj)); // true

The code written in JavaScript prevents the object from being extended and seals the object. As a result, the object cannot be modified.

Download SpellBox today