I am getting data from mysql. The recieved data looks like this before I parse it:
[
{ "reps": 5, "kg": 10, "exercise": "Leg Curl", "date": "14/10/2019" },
{ "reps": 5, "kg": 10, "exercise": "Biceps Curl", "date": "15/10/2019" },
{ "reps": 5, "kg": 10, "exercise": "Dips", "date": "16/10/2019" },
{ "reps": 5, "kg": 10, "exercise": "Dips", "date": "16/10/2019" }
]
What I am trying to do is to sum the data that has the same exercise and date. I guess I can do a loop and sum the data, but how can I make it sum only the ones with same date and exercise?