* The base implementation of `_.findIndex` and `_.findLastIndex` without * support for callback shorthands and `this` binding. * * @private * @param {Array} array The array to search. * @param {Function} predicate The function invoked per iteration. * @param {boolean} [fromRight] S
(array, predicate, fromRight)
| 1803 | * @returns {number} Returns the index of the matched value, else `-1`. |
| 1804 | */ |
| 1805 | function baseFindIndex(array, predicate, fromRight) { |
| 1806 | var length = array.length, |
| 1807 | index = fromRight ? length : -1; |
| 1808 | |
| 1809 | while ((fromRight ? index-- : ++index < length)) { |
| 1810 | if (predicate(array[index], index, array)) { |
| 1811 | return index; |
| 1812 | } |
| 1813 | } |
| 1814 | return -1; |
| 1815 | } |
| 1816 | |
| 1817 | /** |
| 1818 | * The base implementation of `_.indexOf` without support for binary searches. |
no outgoing calls
no test coverage detected