Function reduce

  • Reduce values of array to a single value.

    Type Parameters

    • T

    • U = T

    Parameters

    • x: T[]

      an array

    • fr: ReduceFunction<T, T | U>

      reduce function (acc, v, i, x)

    • Optional acc: T | U

      initial value

    Returns T | U

    fr(fr(acc, v₀), v₁)... | fr(acc, v₀) = v₀ if acc not given

Generated using TypeDoc