Used to iterate over an array and run the function closure for each item in the array.
ArrayEach(array=[array], callback=[function:Consumer], parallel=[boolean], maxThreads=[integer], ordered=[boolean], initialValue=[any])
Argument | Type | Required | Description | Default |
---|---|---|---|---|
array |
array |
true |
The array to reduce | |
callback |
function:Consumer |
true |
The function to invoke for each item. The function will be passed 3 arguments: the value, the index, the array. You can alternatively pass a Java Comparator which will only receive the 1st arg. | |
parallel |
boolean |
false |
Specifies whether the items can be executed in parallel | false |
maxThreads |
integer |
false |
The maximum number of threads to use when parallel = true | |
ordered |
boolean |
false |
(BoxLang only) whether parallel operations should execute and maintain order | false |
initialValue |
any |
false |
- ArrayAppend
- ArrayAvg
- ArrayClear
- ArrayContains
- ArrayContainsNoCase
- ArrayDelete
- ArrayDeleteAt
- ArrayDeleteNoCase
- ArrayEvery
- ArrayFilter
- ArrayFind
- ArrayFindAll
- ArrayFindAllNoCase
- ArrayFindNoCase
- ArrayFirst
- ArrayGetMetadata
- ArrayIndexExists
- ArrayInsertAt
- ArrayIsDefined
- ArrayLast
- ArrayMap
- ArrayMax
- ArrayMedian
- ArrayMerge
- ArrayMid
- ArrayMin
- ArrayNew
- ArrayPop
- ArrayPrepend
- ArrayPush
- ArrayRange
- ArrayReduce
- ArrayReduceRight
- ArrayResize
- ArrayReverse
- ArraySet
- ArrayShift
- ArraySlice
- ArraySome
- ArraySort
- ArraySplice
- ArraySum
- ArraySwap
- ArrayToList
- ArrayToStruct
- ArrayUnshift