Perform a single-pass map-reduce operation against each element in an array and return the accumulated result.