Last active
February 21, 2022 22:46
-
-
Save blarfoon/e762ddd4e05550ad1e9e01dec66cab22 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const myObject = { | |
hi: "mom", | |
}; | |
console.log(myObject.hasOwnProperty("hi")); // > true | |
delete myObject.hi; | |
console.log(myObject.hasOwnProperty("hi")); // > false | |
// PAY ATTENTION NOW | |
Object.defineProperty(myObject, "hi", { | |
value: "mom", | |
configurable: false, | |
}); | |
console.log(myObject.hasOwnProperty("hi")); // > true | |
delete myObject.hi; | |
console.log(myObject.hasOwnProperty("hi")); // > true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment