Skip to content

Instantly share code, notes, and snippets.

@matthewp
Created September 11, 2018 17:38
Show Gist options
  • Save matthewp/f2d87d9146a52f7c1ee482e8cdff95de to your computer and use it in GitHub Desktop.
Save matthewp/f2d87d9146a52f7c1ee482e8cdff95de to your computer and use it in GitHub Desktop.
For in loops
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