While working on my project, I encountered a problem when trying to create an array of objects:
Error TS1110: Type expected
Error TS1109: Expression expected
https://i.sstatic.net/Y5qb8.png
This is how my array is structured:
export let COUNTRIES: Array<{ name: string, segments: number[] }> = Array({
"name":"Afghanistan",
"segments":[
4687,
4787,
4790,
4795,
4880
]},{
"name":"Albania",
"segments":[
4136,
4248
]})
I attempted to use this solution from Stack Overflow but it did not work for me.
Also tried using an interface, but encountered another issue: