* 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 array to inspect. * @param {Function} [predicate=
(array, predicate, fromIndex)
| 54385 | * // => 2 |
| 54386 | */ |
| 54387 | function findIndex(array, predicate, fromIndex) { |
| 54388 | var length = array == null ? 0 : array.length; |
| 54389 | if (!length) { |
| 54390 | return -1; |
| 54391 | } |
| 54392 | var index = fromIndex == null ? 0 : toInteger(fromIndex); |
| 54393 | if (index < 0) { |
| 54394 | index = nativeMax(length + index, 0); |
| 54395 | } |
| 54396 | return baseFindIndex(array, baseIteratee(predicate, 3), index); |
| 54397 | } |
| 54398 | |
| 54399 | module.exports = findIndex; |
| 54400 |
nothing calls this directly
no test coverage detected