Created
April 7, 2020 12:34
-
-
Save radzserg/a5e26991cef5c4aab5c8b1cf57eea710 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 RoastedDuckReceipt { | |
| public cook() { | |
| console.log("Prepare the duck"); | |
| console.log("Add spices"); | |
| console.log("Roast the duck for 3 hours"); | |
| console.log("Make a sauce"); | |
| } | |
| } | |
| class CeasarSaladReceipt { | |
| public cook() { | |
| console.log("mix salmon, avocado rest of ingredients"); | |
| } | |
| } | |
| class DrinksReceipt { | |
| public cook() { | |
| console.log("Pepsi for kids"); | |
| console.log("Jack Daniels for grandfather") | |
| } | |
| } | |
| class Cook { | |
| public makeDinner() { | |
| (new RoastedDuckReceipt()).cook(); | |
| (new CeasarSaladReceipt()).cook(); | |
| (new DrinksReceipt()).cook(); | |
| } | |
| } | |
| const mom = new Cook(); | |
| mom.makeDinner(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment