Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
delete user.firstName
console.log(user.firstName) //undefined
console.log(Object.keys(user) // [ 'lastName', 'fullname' ]
// But if we set a property to 'undefined', the property still exits and the object still contains its key.
user.firstName = undefined
console.log(Object.keys(user)) // [ 'lastName', 'fullname', 'firstName' ]
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.