Pike v8.0 release 1738

Method Array.reduce()


Method reduce

mixed reduce(function(:void) fun, array arr, mixed|void zero)

Description

reduce() sends the first two elements in arr to fun, then the result and the next element in arr to fun and so on. Then it returns the result. The function will return zero if arr is the empty array. If arr has only one element, that element will be returned.

See also

rreduce()