Last active
October 20, 2015 15:12
-
-
Save dtinth/5cddb502cfc466972e51 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
| class Animal { | |
| describe () { | |
| return `An ${this.animalType} with ${this.furColor} fur, | |
| ${this.legs} legs, and a ${this.tail} tail.` | |
| } | |
| static mouse () { | |
| return Object.assign(new Animal, { | |
| animalType: 'mouse', | |
| furColor: 'brown', | |
| legs: 4, | |
| tail: 'long, skinny', | |
| }) | |
| } | |
| } | |
| Object.assign(Animal.prototype, { | |
| animalType: 'animal', | |
| }) | |
| let mickey = Animal.mouse() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment