Use reduce() to get sum of interval of array of values

One way of getting the sum of a given interval of an array of values.