Created
November 26, 2018 11:13
-
-
Save ragmha/4f71f656019a8c1299f611b4f9b9525d 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
interface Pizza { | |
name: string; | |
sizes: string[]; | |
} | |
let pizza: Pizza; | |
function createPizza(name: string, sizes: string[]): Pizza { | |
return { name, sizes }; | |
} | |
pizza = createPizza("Pepperoni", ["small", "medium"]); | |
console.log(`Pizza ordered => ${JSON.stringify(pizza)}`); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment