Function reduce

  • Type Parameters

    • T

    • S

    • Context

    Parameters

    • arr: readonly T[]
    • cb: ((this, previousValue, currentValue, currentIndex?, arr?) => S)
        • (this, previousValue, currentValue, currentIndex?, arr?): S
        • Parameters

          • this: Context
          • previousValue: S
          • currentValue: T
          • Optional currentIndex: number
          • Optional arr: readonly T[]

          Returns S

    • Optional memo: S
    • Optional context: Context

    Returns S