I have an object:
const transaction = [{
created: 1200,
amount: 200
},{
created: 1200,
amount: 400
},{
created: 1400,
amount: 400
},{
created: 1400,
amount: 300
},{
created: 1500,
amount: 100
}]
Everytime created
has the same value I want to sum the amount
's of the objects. So for example created: 1200
would have an amount of: 600
in total, because multiple created
's where at 1200 so the amount got summed up.