Skip to content

Instantly share code, notes, and snippets.

@ericelliott
Created April 17, 2015 01:53
Show Gist options
  • Save ericelliott/bb02d8adc17d2ba52a4d to your computer and use it in GitHub Desktop.
Save ericelliott/bb02d8adc17d2ba52a4d to your computer and use it in GitHub Desktop.
Proto mouse!
let animal = {
animalType: 'animal',
describe () {
return `An ${this.animalType}, with ${this.furColor} fur,
${this.legs} legs, and a ${this.tail} tail.`;
}
};
let mouse = Object.assign(Object.create(animal), {
animalType: 'mouse',
furColor: 'brown',
legs: 4,
tail: 'long, skinny'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment