I received the API response in JSON format as shown below:
{
Company1: 3
Company2: 3
Company3: 3
Company4: 3
Company5: 3
}
My goal is to convert this response into a JSON array in the following structure:
{
0: {Name:Company1, Index:3},
1: {Name:Company2, Index:3},
2: {Name:Company3, Index:3},
3: {Name:Company4, Index:3},
4: {Name:Company5, Index:3},
}
Can anyone provide guidance on how to achieve this using typescript? Any suggestions would be greatly appreciated.