Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "foldIndexed"

Index

Functions

Functions

foldIndexed

  • foldIndexed<T, R>(this: Sequence<T>, initial: R, operation: function): R
  • Accumulates all elements of the sequence into a single result by applying the given operation starting with the initial value. The result of the last operation will be passed as accumulated value to the next invocation of the operation as well as the index of the current element (zero-based) until all elements of the sequence are processed.

    Type parameters

    • T

    • R

    Parameters

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

          • index: number
          • acc: R
          • element: T

          Returns R

    Returns R