Created
November 19, 2016 16:08
-
-
Save mrosata/bfe818616bbbedd6e7b2f56c4d7c4082 to your computer and use it in GitHub Desktop.
Getting Curried Away - example 1c - Full Gist at https://gist.github.com/mrosata/35e4d80c2b393267a4069fbf045e22a7
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
| // Those 5 lines of code we wrote above to create more specific functions, | |
| // is about the same as writing these 35 lines of code down here... power. | |
| /* So to be clear, we don't have to write these implementations */ | |
| function farmhouse(creams, sugars) { | |
| const coffee = getCoffee('farmhouse blend'); | |
| coffee.add.cream(creams); | |
| coffee.add.suger(sugars); | |
| return coffee; | |
| } | |
| function columbian(creams, sugars) { | |
| const coffee = getCoffee('columbian'); | |
| coffee.add.cream(cream); | |
| coffee.add.suger(sugar); | |
| return coffee; | |
| } | |
| function arrrrrggg(creams, sugars) { | |
| const coffee = getCoffee('half-caff carmel-mocha pumkin-karaoke'); | |
| coffee.add.cream(cream); | |
| coffee.add.suger(sugar); | |
| return coffee; | |
| } | |
| function farmhouseLight(sugars) { | |
| const coffee = getCoffee('farmhouse blend'); | |
| coffee.add.cream(10); | |
| coffee.add.suger(sugar); | |
| return coffee; | |
| } | |
| function farmhouseBlack(sugars) { | |
| const coffee = getCoffee('farmhouse blend'); | |
| coffee.add.cream(0); | |
| coffee.add.suger(sugar); | |
| return coffee; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment