plainfp - v0.1.0
    Preparing search index...

    Function map

    • Apply a transform to each element. Index is passed as the second arg.

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

      Type Parameters

      • T
      • U

      Parameters

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

      Returns U[]

      pipe(
      orders,
      Arrays.map((o) => ({ ...o, total: o.price * o.qty })),
      )
    • Apply a transform to each element. Index is passed as the second arg.

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

      Type Parameters

      • T
      • U

      Parameters

      • fn: (x: T, i: number) => U

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

      pipe(
      orders,
      Arrays.map((o) => ({ ...o, total: o.price * o.qty })),
      )