|
Ds\Sequence::reduceReduces the sequence to a single value using a callback function Description
abstract public mixed Ds\Sequence::reduce(callable
$callback , mixed $initial = ?)Reduces the sequence to a single value using a callback function. Parameters
Return ValuesThe return value of the final callback. ExamplesExample #1 Ds\Sequence::reduce with initial value example
The above example will output something similar to: int(30) Example #2 Ds\Sequence::reduce without an initial value example
The above example will output something similar to: int(21) |