Here's an example of what the object looks like:
informations = {
addresses: {
0: {phone: 0},
1: {phone: 1},
2: {phone: 2},
3: {phone: 3},
4: {phone: 4},
5: {phone: 5},
},
names: {
0: n0,
1: n1,
2: n2,
3: n3,
4: n4,
5: n5,
}
}
How can I obtain the result in this format:
[{phone: 0, name: n0}, {phone:1, name: n1} .....{phone:5, name: n5}]
?
I tried using .map
, but it gave me an error stating "Property 'map' does not exist on type".
Is there a more efficient way to write the code without resorting to a for() loop?