Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "reduceIndexed"

Index

Functions

Functions

reduceIndexed

  • reduceIndexed<S, T>(this: Sequence<T>, operation: function): S
  • Reduces the whole sequence to a single value by invoking operation with each element from left to right. For every invocation of the operation acc is the result of the last invocation. For the first invocation of the operation acc is the first element of the sequence. In addition the index of the current element is also passed to the operation.

    Type parameters

    • S

    • T: S

    Parameters

    • this: Sequence<T>
    • operation: function
        • (index: number, acc: S, element: T): S
        • Parameters

          • index: number
          • acc: S
          • element: T

          Returns S

    Returns S