Skip to content

Instantly share code, notes, and snippets.

@qetr1ck-op
Created September 24, 2015 20:46
Show Gist options
  • Select an option

  • Save qetr1ck-op/f69804da0f8a16a29f79 to your computer and use it in GitHub Desktop.

Select an option

Save qetr1ck-op/f69804da0f8a16a29f79 to your computer and use it in GitHub Desktop.
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