Imagine you have the following array:
const items = [
{
"amount1": "100",
"amount2": "50",
"name": "ruud"
},
{
"amount1": "40",
"amount2": "60",
"name": "ted"
}
]
Your goal is to calculate the sum of all amount1 and amount2 properties, resulting in:
[
{
"amount1": 140,
"amount2": 110
}
]
How would you go about achieving this?