Function indexOf

Returns the index of the first occurrence of a value in an array.

Returns -1 if the value is not found.

indexOf(1)([1, 2, 3]); // => 0
indexOf(1)([2, 3]); // => -1
  • Parameters

    • value: unknown
    • OptionalfromIndex: number

    Returns ((source: readonly unknown[]) => number)

      • (source): number
      • Parameters

        • source: readonly unknown[]

        Returns number