Created
September 24, 2015 20:46
-
-
Save qetr1ck-op/f69804da0f8a16a29f79 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 animal = { | |
| eats: true | |
| }; | |
| var rabbit = { | |
| jumps: true, | |
| __proto__: animal | |
| }; | |
| for (var key in rabbit) { | |
| if (!rabbit.hasOwnProperty(key)) continue; // skip | |
| alert( key + " = " + rabbit[key] ); // "jumps" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment