The array to search.
The value to search for.
Optional
fromIndex: numberThe index to search from.
Returns the index of the matched value, else -1
.
_.indexOf([1, 2, 1, 2], 2);
// => 1
// using `fromIndex`
_.indexOf([1, 2, 1, 2], 2, 2);
// => 3
Generated using TypeDoc
Gets the index at which the first occurrence of
value
is found inarray
usingSameValueZero
for equality comparisons. IffromIndex
is negative, it's used as the offset from the end ofarray
.