Skip to content

Function: array_reduce() ​

array_reduce<T, U>(array, callback, initial): U

Defined in: src/php-arrays.ts:60

Iteratively reduce the array to a single value using a callback function.

Type Parameters ​

T ​

T

U ​

U

Parameters ​

array ​

T[]

The source array

callback ​

(carry, item, index) => U

The callback function

initial ​

U

The initial value

Returns ​

U

The reduced value

Documentation of 1.0.13 , built from cf61d3b on 1.0.13 by pipeline #2985011498 on 2026-10-21.