Created
November 2, 2019 13:38
-
-
Save AkashRajvanshi/fd762ae4c88f4cd6493846c9d3328939 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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