• Applies a function against an accumulator and each element of the given iterable to reduce elements to a single value.

    Type Parameters

    • T

      Iterated elements type.

    • TResult

      A type of reduced value.

    Parameters

    • iterable: Iterable<T>

      An iterable to reduce values of.

    • reducer: ((this, prev, element) => TResult)

      A function to apply the value returned from the previous reducer call and to each element.

        • (this, prev, element): TResult
        • Parameters

          • this: void
          • prev: TResult
          • element: T

          Returns TResult

    • initialValue: TResult

      Initial value passed to the first reducer call.

    Returns TResult

    Reduced value returned from the last reducer call, or initialValue if there is no elements in the given iterable.

Generated using TypeDoc