Skip to content

Instantly share code, notes, and snippets.

@debugmodedotnet
Created December 31, 2018 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save debugmodedotnet/6428baa7d3b52fb17ce8e61bce021a38 to your computer and use it in GitHub Desktop.
Save debugmodedotnet/6428baa7d3b52fb17ce8e61bce021a38 to your computer and use it in GitHub Desktop.
const cat = {
name: 'foo'
}
const babycat = {
age: '1',
color: 'white'
}
//babycat.__proto__ = cat; // I love this more
Object.setPrototypeOf(babycat, cat);
for (var prop in babycat) {
console.log(prop);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment