I have this array of objects:
[{
"Germany": "text",
"Brazil": "50.00"
}, {
"Germany": "1000.00",
"Brazil": "1100.00"
}, {
"Germany": "999999999",
"Brazil": "9999999",
"France": "12"
}]
I want to convert it to the following structure:
[{
"name": "Germany",
"value": 999999999
}, {
"name": "Brazil",
"value": 999999999
}, {
"name": "France",
"value": 12
}]
Where in the second object we use the higher value for each of the keys in the first object.
Edit: a value could also be text, like "Germany": "text" , in that case that value should be ignored. I added that case in the first object above.
Francein the end result? What if the value forBrazilin the last object would be999? Would the value in the result be1100.00then?Objectclass to get keys, values and key-value pairs (entries) for each object in the array. Tip 2: This isn't really a suitable question for stackoverflow. However, you could search for answers to step 1-3.