plainfp - v0.1.0
    Preparing search index...

    Function sumBy

    • Sum the numeric projection of each element. Empty input returns 0.

      Dual API — works data-first or curried for use in pipe.

      Type Parameters

      • T

      Parameters

      • xs: readonly T[]
      • fn: (x: T) => number

      Returns number

      pipe(
      orders,
      Arrays.sumBy((o) => o.total),
      )
    • Sum the numeric projection of each element. Empty input returns 0.

      Dual API — works data-first or curried for use in pipe.

      Type Parameters

      • T

      Parameters

      • fn: (x: T) => number

      Returns (xs: readonly T[]) => number

      pipe(
      orders,
      Arrays.sumBy((o) => o.total),
      )