Created
December 31, 2018 09:17
-
-
Save debugmodedotnet/6428baa7d3b52fb17ce8e61bce021a38 to your computer and use it in GitHub Desktop.
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
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