dict-utils

Home > dict-utils > dictReduce

dictReduce() function

Iterate over a dictionary to incrementally create a single value

Signature:

export declare function dictReduce<T, R>(from: Dict<T>, reducer: IReducerFn<T, R>, initialVal: R): R;

Parameters

Parameter Type Description
from Dict<T> dictionary to iterate over
reducer IReducerFn<T, R> reducer function
initialVal R initial value that the accumulator starts with

Returns:

R