* Gets the index at which the first occurrence of `value` is found using * strict equality for comparisons, i.e. `===`. If the array is already sorted * providing `true` for `fromIndex` will run a faster binary search. * * @static * @memberOf _ * @category Arrays *
(array, value, fromIndex)
| 39531 | * // => 2 |
| 39532 | */ |
| 39533 | function indexOf(array, value, fromIndex) { |
| 39534 | if (typeof fromIndex == 'number') { |
| 39535 | var length = array ? array.length : 0; |
| 39536 | fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0); |
| 39537 | } else if (fromIndex) { |
| 39538 | var index = sortedIndex(array, value); |
| 39539 | return array[index] === value ? index : -1; |
| 39540 | } |
| 39541 | return baseIndexOf(array, value, fromIndex); |
| 39542 | } |
| 39543 | |
| 39544 | /** |
| 39545 | * Gets all but the last element or last `n` elements of an array. If a |
no test coverage detected