Last active
August 29, 2015 14:04
-
-
Save chiefGui/b1c8757574dac3d96542 to your computer and use it in GitHub Desktop.
This file contains 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
/** | |
* Em referência à https://gist.github.com/guisouza/8c592323f833d981cf1c | |
**/ | |
/** | |
* No exemplo, o gato come Fish | |
* e depois come Food, mas pela lógica, | |
* Fish e Food já devem existir: ele não | |
* pode comer algo abstrato. | |
* | |
* Portanto... | |
**/ | |
var salmon = new Fish({ name: 'Salmon' }) | |
, potato = new Food({ name: 'Potato' }); | |
steveTheCat.eat(salmon); | |
steveTheCat.eat(potato); | |
anAnimal.eat(steveTheCat); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment