I have this data in var output (this is just an excerpt):
{
'us-tx-021': 5,
'us-tx-029': 3,
'us-tx-031': 1,
}
I need to convert it to something like this:
[
{
'hc-key': "us-tx-021",
'value': 5
},
{
'hc-key': "us-tx-029",
'value': 3
},
{
'hc-key': "us-tx-031",
'value': 1
}
]
I don’t know how to use the keys & values from one object as values for another object. Can anyone help me?