indexOf()
indexOf<
T
>(x
): (arr
) =>number
Returns the first index as which a given element can be found in the array. Returns -1
otherwise.
Type Parameters
• T
Parameters
x
T
The value to find in the array.
Returns
Function
Parameters
arr
T
[]
Returns
number
Remark
pure function
Example
indexOf(3)([[1, 2, 3, 4, 5]])
// 2