listReduce
11
4

Overview ColdFusion Open BlueDragon Lucee

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

Attributes

Name Required Type Default Description
4
closure No function/closure that implements the following constructor [function(any result, object value, numeric index , string list, string delimiter):any].
11
4
delimiter No String List delimiter
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: value. Requiredindex : current index for the iteration. Optionallist : reference of the original list. Optional
4
includeEmptyFields No include empty fields or not
11
includeEmptyValues No Boolean Set to yes to include empty values
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
11
4
list Yes List Input list
4
multiCharacterDelimiter No specifying whether the delimiters parameter specifies a multi-character delimiter. If this parameter is true, the delimiters parameter must specify a single delimiter consisting of multiple characters. This parameter enables the ListToArray function to convert a list such as the following to an array of color names: red:|orange:|yellow:|green:|blue:|indigo:|violet.