Function reduce

  • Reduce values of set to a single value.

    Type Parameters

    • T

    • U = T

    Parameters

    • x: Set<T>

      a set

    • fr: ReduceFunction<T, T | U>

      reduce function (acc, v, v, 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