MCPcopy Create free account
hub / github.com/RubyLouvre/anu / findIndex

Function findIndex

test/babel.js:54387–54397  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

toIntegerFunction · 0.85
baseFindIndexFunction · 0.85
baseIterateeFunction · 0.85

Tested by

no test coverage detected