* The base implementation of `_.findIndex` and `_.findLastIndex` without * support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} predicate The function invoked per iteration. * @param {number} fromIndex The index to search fr
(array, predicate, fromIndex, fromRight)
| 810 | * @returns {number} Returns the index of the matched value, else `-1`. |
| 811 | */ |
| 812 | function baseFindIndex(array, predicate, fromIndex, fromRight) { |
| 813 | var length = array.length, |
| 814 | index = fromIndex + (fromRight ? 1 : -1); |
| 815 | |
| 816 | while ((fromRight ? index-- : ++index < length)) { |
| 817 | if (predicate(array[index], index, array)) { |
| 818 | return index; |
| 819 | } |
| 820 | } |
| 821 | return -1; |
| 822 | } |
| 823 | |
| 824 | /** |
| 825 | * The base implementation of `_.indexOf` without `fromIndex` bounds checks. |
no test coverage detected