ixfx
    Preparing search index...

    Function findIndex

    • Like Array.findIndex but with optional startAt and length parameters to limit the search to a specific section of the array.

      const data = ["red","blue","red","blue"]
      data.findIndex(v => v === `red`); // 0 - finds first match
      findIndex(data, v => v === `red`, 1); // 2 - finds first match after start index of 1

      Use findIndexReverse to search backwards through the array.

      Type Parameters

      • V

      Parameters

      • array: readonly V[]
      • predicate: (value: V, index: number, obj: readonly V[]) => boolean
      • OptionalstartInclusive: number
      • OptionalendExclusive: number

        End index (exclusive). By default, uses array.length

      Returns number