plainfp - v0.1.0
    Preparing search index...

    Function findIndex

    • Locate the index of the first element matching predicate, wrapped in an Optionnone replaces the native -1 sentinel.

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

      Type Parameters

      • T

      Parameters

      • xs: readonly T[]
      • predicate: (x: T, i: number) => boolean

      Returns OptionType<number>

      pipe(
      orders,
      Arrays.findIndex((o) => o.status === "shipped"),
      )
    • Locate the index of the first element matching predicate, wrapped in an Optionnone replaces the native -1 sentinel.

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

      Type Parameters

      • T

      Parameters

      • predicate: (x: T, i: number) => boolean

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

      pipe(
      orders,
      Arrays.findIndex((o) => o.status === "shipped"),
      )