suppose we have an array of objects like this:
array = [{
amount: 1000,
cur: EUR
}, {
amount: 1500,
cur: GBD
}, {
amount: 2000,
cur: USD
}, {
amount: 2500,
cur: SSL
}]
Now I want to create a sum variable for this array which contains the sum of the amounts field whose cur isn't EUR and USD. To be more specific, I want a variable like sumOther which is equal to 1500 + 2500 = 4000. This variable contains the sum of the amounts whose cur is not EUR and USD.