I understand how to specify the type for a variable.
let members: string[] = [] // this example works flawlessly
My goal is to have an array of strings within an object. How can I structure it correctly?
const team = {
name: String,
members<string[]>: [], // encountering an error with this code!!
}
The resolution
const team = {
name: String,
members: [] as string[]
}