• Reduces the iterable using the given reducer function.

    Type Parameters

    • T

    Parameters

    • it: Iterable<any>
    • reducer: ((value, item, i?) => boolean)
        • (value, item, i?): boolean
        • Parameters

          • value: any
          • item: any
          • Optional i: number

          Returns boolean

    • Optional value: any

    Returns T

    Example

    import { reduce } from 'deleight/generators';
    reduce(range(10), ((r, i) => r * i), 3);