MCPcopy Index your code
hub / github.com/stemkoski/stemkoski.github.com / indexOf

Function indexOf

MathBox/mathbox-bundle.js:39533–39542  ·  view source on GitHub ↗

* Gets the index at which the first occurrence of `value` is found using * strict equality for comparisons, i.e. `===`. If the array is already sorted * providing `true` for `fromIndex` will run a faster binary search. * * @static * @memberOf _ * @category Arrays *

(array, value, fromIndex)

Source from the content-addressed store, hash-verified

39531 * // => 2
39532 */
39533 function indexOf(array, value, fromIndex) {
39534 if (typeof fromIndex == 'number') {
39535 var length = array ? array.length : 0;
39536 fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0);
39537 } else if (fromIndex) {
39538 var index = sortedIndex(array, value);
39539 return array[index] === value ? index : -1;
39540 }
39541 return baseIndexOf(array, value, fromIndex);
39542 }
39543
39544 /**
39545 * Gets all but the last element or last `n` elements of an array. If a

Callers 5

baseDifferenceFunction · 0.70
baseUniqFunction · 0.70
containsFunction · 0.70
intersectionFunction · 0.70
mathbox-bundle.jsFile · 0.70

Calls 2

sortedIndexFunction · 0.85
baseIndexOfFunction · 0.85

Tested by

no test coverage detected