Created
November 26, 2018 12:48
-
-
Save ragmha/62eeb21752f2e034ad0fa32c81b68fec 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 Pizza { | |
| public toppings: string[] = []; | |
| constructor(private name: string) {} | |
| public addTopping(topping: string) { | |
| this.toppings.push(topping); | |
| } | |
| } | |
| const pizza = new Pizza("Pepperoni"); | |
| pizza.addTopping("pepperoni"); | |
| console.log(pizza); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment