I have a JSON object with different cryptocurrency values:
{
"BTC": "0",
"XCP": "0",
"NOBL": "0",
"USDE": "0",
"SOC": "0",
"KDC": "0",
"DOGE": "0.00000001"
}
What I want is to convert it into an array of objects like this:
[
{ "Coin": "BTC",
"Value": "0"
},
{ "Coin": "XCP",
"Value": "0"
},
{ "Coin": "NOBL",
"Value": "0"
},
{ "Coin": "USDE",
"Value": "0"
},
{ "Coin": "SOC",
"Value": "0"
},
{ "Coin": "KDC",
"Value": "0"
},
{ "Coin": "DOGE",
"Value": "0.00000001"
}
]
I am not sure how to achieve this, maybe using a foreach key function, but any guidance would be appreciated. Thank you.