Guest User

Untitled

a guest
May 4th, 2016
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. let animal = {
  2. animalType: 'animal',
  3.  
  4. describe () {
  5. return `An ${this.animalType} with ${this.furColor} fur,
  6. ${this.legs} legs, and a ${this.tail} tail.`;
  7. }
  8. };
  9.  
  10. let mouseFactory = function mouseFactory () {
  11. return Object.assign(Object.create(animal), {
  12. animalType: 'mouse',
  13. furColor: 'brown',
  14. legs: 4,
  15. tail: 'long, skinny'
  16. });
  17. };
  18.  
  19. let mickey = mouseFactory();
Add Comment
Please, Sign In to add comment