I faced this issue a lot in my early days of Typescript. I think you might be interested in Maps. Also keep in mind this is TypeScript and "type" is very important in contrast to Javascript. I didn't see types in your example, so I was little unclear on what you want. Here's an example using Maps that might help or give you some ideas. Of course you can also create your own class for this, which would allow for whatever you want. And take advantage of Typescript by providing types. It's annoying at first but really helps.
class MyObject {
a: number
}
let myArray:MyObject[] = []
let a = new Map()
a.set('1',true)
a.set('2',true)
a.set('3',true)
a.set('1',true)
a.forEach( (value,key) => {
let obj = new MyObject()
obj.a = value
myArray.push(obj)
})
console.log(myArray)
Which would display:
(3) [MyObject {...}, MyObject {...}, MyO...]
0: MyObject {a: "1"}
1: MyObject {a: "2"}
2: MyObject {a: "3"}