I have an interface for icecream and it looks like so:
interface Icecream {
name: string
sorbet?: boolean
}
Now I want to create an object which contains a property icecreams, and I want that property to be an array of type Icecream. How can I tell Typescript that, since the colon : notation is already used for assignment?
const myFavs = {
icecreams: [
{
name: 'Vanilla',
sorbet: false
},
{
name: 'Strawberry',
sorbet: true
}
]
}