|
Ds\Map::reduceReduces the map to a single value using a callback function. Beschreibung
public mixed Ds\Map::reduce
( callable
$callback
[, mixed $initial
] )Reduces the map to a single value using a callback function. Parameter-Liste
RückgabewerteThe return value of the final callback. BeispieleBeispiel #1 Ds\Map::reduce with initial value example
<?phpDas oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie: int(30) Beispiel #2 Ds\Map::reduce without an initial value example
<?phpDas oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie: int(21) |