Skip to content

Instantly share code, notes, and snippets.

@qetr1ck-op
Created September 26, 2015 10:21
Show Gist options
  • Save qetr1ck-op/d57b779a057e164bf1d2 to your computer and use it in GitHub Desktop.
Save qetr1ck-op/d57b779a057e164bf1d2 to your computer and use it in GitHub Desktop.
let owl = {
sayHello(str) {
return `Hello ${str} !`;
}
}
let winnie = {};
winnie.__proto__ = owl;
let donkey = {};
donkey.__proto__ = owl;
console.log(donkey.sayHello('prototype chain')) // Hello ! prototype chain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment