Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const user = {
firstName: 'Akash'
};
// Currently it is Extensible
console.log(Object.isExtensible(user)) // true
Object.preventExtensions(user)
console.log(Object.isExtensible(user)) // false
// Trying to adding something
user.lastName = 'Rajvanshi'
console.log('lastName' in user) // false ( We can't make additions to the 'user' object)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.