* This method is like `_.indexOf` except that it iterates over elements of * `array` from right to left. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. *
(array, value, fromIndex)
| 7728 | * // => 1 |
| 7729 | */ |
| 7730 | function lastIndexOf(array, value, fromIndex) { |
| 7731 | var length = array == null ? 0 : array.length; |
| 7732 | if (!length) { |
| 7733 | return -1; |
| 7734 | } |
| 7735 | var index = length; |
| 7736 | if (fromIndex !== undefined) { |
| 7737 | index = toInteger(fromIndex); |
| 7738 | index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); |
| 7739 | } |
| 7740 | return value === value |
| 7741 | ? strictLastIndexOf(array, value, index) |
| 7742 | : baseFindIndex(array, baseIsNaN, index, true); |
| 7743 | } |
| 7744 | |
| 7745 | /** |
| 7746 | * Gets the element at index `n` of `array`. If `n` is negative, the nth |
nothing calls this directly
no test coverage detected