Lucee Function Reference

arrayreduce()

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.

Example

arrayreduce(array array,function closure,[object initialValue]):any

Category

array,iterator

Arguments

The arguments for this function are set. You can not use other arguments except the following ones.
Name Type Required Description
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