Created
February 27, 2020 21:28
-
-
Save L3au/078eed01afd4dc75cbda6b98e4fe314b to your computer and use it in GitHub Desktop.
Getting Object Property Descriptors
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
Open the console in CodePen or in your browser's Developer Tools. |
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
console.clear(); | |
const myDog = { | |
kind: 'Labradoodle', | |
color: 'brown', | |
weight: '70 lbs' | |
}; | |
console.log(Object.getOwnPropertyDescriptor(myDog, 'kind')); | |
console.log(Object.getOwnPropertyDescriptor(myDog, 'color')); | |
console.log(Object.getOwnPropertyDescriptors(myDog)); |
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
body { | |
padding: 20px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment