* This method is like `_.find` except that it returns the index of the first * element `predicate` returns truthy for instead of the element itself. * * @static * @memberOf _ * @since 1.1.0 * @category Array * @param {Array} array The ar
(array, predicate, fromIndex)
| 17874 | * // => 2 |
| 17875 | */ |
| 17876 | function findIndex(array, predicate, fromIndex) { |
| 17877 | var length = array == null ? 0 : array.length; |
| 17878 | if (!length) { |
| 17879 | return -1; |
| 17880 | } |
| 17881 | var index = fromIndex == null ? 0 : toInteger(fromIndex); |
| 17882 | if (index < 0) { |
| 17883 | index = nativeMax(length + index, 0); |
| 17884 | } |
| 17885 | return baseFindIndex(array, getIteratee(predicate, 3), index); |
| 17886 | } |
| 17887 | |
| 17888 | /** |
| 17889 | * This method is like `_.findIndex` except that it iterates over elements |
nothing calls this directly
no test coverage detected