arrayReduce
11
4

Overview ColdFusion Open BlueDragon Lucee

Reduce function that iterates over each entries of the array and call the closure to work on the element of the array. This function would reduce the array to a single value which would be returned

Attributes

Name Required Type Default Description
11
4
array Yes Array Input Array
4
closure No function/closure that implements the following constructor [function(any result, object value, [, numericindex [, array]]):any].
11
function Yes Function Closure or a function reference that will called for each of the iteration. The arguments passed to the callback areresult : result of the reduce operation after the previous iteration. Requireditem : item in the array. RequiredIndex : index of the array. Optionalarray : reference of the array. Optional
4
initalValue No inital value passed as part of the first closure call
11
initialValue No Any Initial value which will be used for reduce operation