Iterates over every entry of the given array and calls the closure with every element.
This function will reduce the array to a single value and will return the value.
Lucee Function Reference
arrayreduce()
Beispiel
arrayreduce(array array,function closure,[object initialValue]):any
Kategorie
array,iterator
Argumente
Die Argumente für diese Funktion sind fest vorgegeben. Ausser den nachfolgenden Argumenten dürfen keine weiteren verwendet werden.
Name | Typ | Required | Beschreibung |
---|---|---|---|
array | array | Yes | array to iterate |
closure | function | Yes | function/closure that implements the following constructor [function(any result, object value, [, numericindex [, array]]):any]. |
initialValue | object | No | inital value passed as part of the first closure call |