reduce async
Updated on August 22, 2024Source codeTests
createReduceAsync
is a pipe that asynchronously transforms an array to a reduced array (which can be any data type).
Create reduce
Call createReduceAsync
with these parameters to create your reduce
function:
Parameter
Type
Required
Description
accumulate
Function
yes
A function that returns a Promise
that resolves to the accumulated value.
accumulate
receives the accumulated value (any data type), the current item (any data type), and the current item's index (number) as parameters.
initialValue
any
no
The initial value of the accumulator.
Defaults to undefined
.