reduce

fnT reduce(R, F, T)(R range, F func, T initial)

Returns the result of applying a function cumulatively to all elements.