If the data is like: -
const dis ={
"data":[
{
"Hazard_type": ["Tornado","Hurricane"],
"County": "Anderson",
"State": "TX",
"FIPS_code": 48001,
"Longitude": -95.687072,
"Latitude": 31.776143,
"Property_Damage": 10000000,
"Crop_Damage": 0
},
{
"Hazard_type": ["Hurricane"],
"County": "Anderson",
"State": "TX",
"FIPS_code": 48001,
"Longitude": -95.687072,
"Latitude": 31.776143,
"Property_Damage": 4914933.84,
"Crop_Damage": 0
},
]
}
And I want to create another json array which has aggregate damage per unique tag in the Hazard type. What should be the approach here? (Very new to Javascript)