Home > rc-js-util > arrayCollect
Like Array.reduce
but without the requirement to return the value in the callback.
Signature:
export declare function arrayCollect<TRet, TItem>(items: ArrayLike<TItem>, collected: TRet, collect: (collected: TRet, item: TItem, index: number) => void): TRet;
Parameter | Type | Description |
---|---|---|
items | ArrayLike<TItem> | |
collected | TRet | |
collect | (collected: TRet, item: TItem, index: number) => void |
Returns:
TRet
See arrayCollect().