Created
July 8, 2018 21:35
-
-
Save sevperez/138f3b0d43b81a8502f8ccf612d812c3 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
var prices = [400, 80, 375, 870]; | |
var products = { | |
"widget": 400, | |
"gear": 80, | |
"crank": 375, | |
"lever": 870, | |
}; | |
var pricesDescriptors = Object.getOwnPropertyDescriptors(prices); | |
console.log(pricesDescriptors); | |
// logs: | |
// { 0: {value: 400, writable: true, enumerable: true, configurable: true}, | |
// 1: {value: 80, writable: true, enumerable: true, configurable: true}, | |
// 2: {value: 375, writable: true, enumerable: true, configurable: true}, | |
// 3: {value: 870, writable: true, enumerable: true, configurable: true}, | |
// length: {value: 4, writable: true, enumerable: false, configurable: false} } | |
var productsDescriptors = Object.getOwnPropertyDescriptors(products); | |
console.log(productsDescriptors); | |
// logs: | |
// { crank: {value: 375, writable: true, enumerable: true, configurable: true}, | |
// gear: {value: 80, writable: true, enumerable: true, configurable: true}, | |
// lever: {value: 870, writable: true, enumerable: true, configurable: true}, | |
// crank: {value: 375, writable: true, enumerable: true, configurable: true} } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment