Created
September 11, 2018 17:38
-
-
Save matthewp/f2d87d9146a52f7c1ee482e8cdff95de to your computer and use it in GitHub Desktop.
For in loops
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
let grandparent = Object.create(Object.prototype, { | |
foo: { | |
enumerable: true, | |
configurable: true, | |
writable: true, | |
value: "1" | |
} | |
}) | |
let parent = Object.create(grandparent, { | |
foo: { | |
enumerable: false, | |
configurable: true, | |
writable: true, | |
value: "2" | |
} | |
}); | |
let obj = Object.create(parent); | |
for(let prop in obj) { | |
console.log(prop, obj[prop]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment