- _reduce<T1, T2>(fn, val, arr): T2
Parameters
- fn: ((acc, val, index?, arr?) => T2)
- (acc, val, index?, arr?): T2
Parameters
- acc: T2
- val: T1
Optional
index: numberOptional
arr: T1[]
Returns T2
- val: T2
- arr: T1[]
Returns T2
- _reduce<T1, T2>(fn, val, obj): T2
Parameters
- fn: ((acc, val, key?, obj?) => T2)
- (acc, val, key?, obj?): T2
Parameters
- acc: T2
- val: T1
Optional
key: stringOptional
obj: Record<string, T1>
Returns T2
- val: T2
- obj: Record<string, T1>
Returns T2
Reduce array or object by appling function
For each element, provided function is called with accumulator, elements value, element index/key and original container.