Sha256: a096e98d6c7cb1dbf059a4215c3bb56e466f5c242c8cc495078f4b1c65591734
Contents?: true
Size: 709 Bytes
Versions: 153
Compression:
Stored size: 709 Bytes
Contents
/** * 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] Specify iterating from right to left. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseFindIndex(array, predicate, fromRight) { var length = array.length, index = fromRight ? length : -1; while ((fromRight ? index-- : ++index < length)) { if (predicate(array[index], index, array)) { return index; } } return -1; } module.exports = baseFindIndex;
Version data entries
153 entries across 80 versions & 8 rubygems