Getting the sum of all order_cost in array

hi,

In my angular application I am pushing numbers to an array, so the following:

r[0].order_cost == 269
r[1].order_cost == 369

\\ there may even be another number r[3].order_cost == 123

I would like to sum these numbers in the array ‘r’

so I get TOTAL AMOUNT: 638

Use Array.reduce