Classes
Methods
# filter(callback, parallel)
Pass items only when callback returns true.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
callback |
async function (must return Promise). | ||
parallel |
1 | number of callbacks runs in parallel |
# async forEach(callback, parallel)
The forEach() method executes a provided function once for each array element
Parameters:
Name | Type | Default | Description |
---|---|---|---|
callback |
async function (must return Promise). | ||
parallel |
1 | max items, that can be processed at same time. Optional parameter, equals 1 by default |
# map(callback, parallel)
Transform input items
Parameters:
Name | Type | Default | Description |
---|---|---|---|
callback |
async function (must return Promise), which transform input item to output item | ||
parallel |
1 | number of callbacks runs in parallel |
# async reduce(callback, initialValue)
Calls the specified callback function for all the input elements.
The return value of the callback function is the accumulated result,
and is provided as an argument in the next call to the callback function.
Parameters:
Name | Type | Description |
---|---|---|
callback |
A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. Must return promise or be async. | |
initialValue |
initialValue is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument. |
# async toArray()
The toArray() method collect itertor items to array.