fx-flow v0.7.0 / pipe/strict / reduce
Function: reduce()
reduce(fn, iterable)
reduce<
A
>(fn
,iterable
):undefined
'reduce' boils down a list of values into a single value.
Type parameters
• A extends readonly []
Parameters
• fn: AnyFunction
• iterable: A
Returns
undefined
Example
console.log(reduce((a, b) => a + b, [1, 2, 3, 4])) // 10
Source
packages/core/src/pipe/strict/reduce.ts:46
reduce(fn, initialRes, iterable)
reduce<
A
,R
>(fn
,initialRes
,iterable
):R
Type parameters
• A extends readonly []
• R
Parameters
• fn: AnyFunction
• initialRes: R
• iterable: A
Returns
R
Source
packages/core/src/pipe/strict/reduce.ts:47
reduce(fn, iterable)
reduce<
A
>(fn
,iterable
):IterableReturnValue
<A
>
Type parameters
• A extends UniversalIterable
Parameters
• fn
• iterable: A
Returns
Source
packages/core/src/pipe/strict/reduce.ts:50
reduce(fn)
reduce<
A
>(fn
): (iterable
) =>IterableReturnValue
<A
>
Type parameters
• A extends UniversalIterable
Parameters
• fn
Returns
Function
Parameters
• iterable: A
Returns
Source
packages/core/src/pipe/strict/reduce.ts:54
reduce(fn, iterable)
reduce<
A
,R
>(fn
,iterable
):IterableReturnValue
<A
,R
>
Type parameters
• A extends UniversalIterable
• R
Parameters
• fn
• iterable: A
Returns
IterableReturnValue
<A
, R
>
Source
packages/core/src/pipe/strict/reduce.ts:59
reduce(fn)
reduce<
A
,R
>(fn
): (iterable
) =>IterableReturnValue
<A
,R
>
Type parameters
• A extends UniversalIterable
• R
Parameters
• fn
Returns
Function
Parameters
• iterable: A
Returns
IterableReturnValue
<A
, R
>
Source
packages/core/src/pipe/strict/reduce.ts:63
reduce(fn, initialRes, iterable)
reduce<
A
,R
>(fn
,initialRes
,iterable
):IterableReturnValue
<A
,R
>
Type parameters
• A extends UniversalIterable
• R
Parameters
• fn
• initialRes: R
• iterable: A
Returns
IterableReturnValue
<A
, R
>
Source
packages/core/src/pipe/strict/reduce.ts:68
reduce(fn, initialRes)
reduce<
A
,R
>(fn
,initialRes
): (iterable
) =>IterableReturnValue
<A
,R
>
Type parameters
• A extends UniversalIterable
• R
Parameters
• fn
• initialRes: R
Returns
Function
Parameters
• iterable: A
Returns
IterableReturnValue
<A
, R
>