MCPcopy
hub / github.com/stemkoski/stemkoski.github.com / baseIndexOf

Function baseIndexOf

MathBox/mathbox-bundle.js:35304–35314  ·  view source on GitHub ↗

* The base implementation of `_.indexOf` without support for binary searches * or `fromIndex` constraints. * * @private * @param {Array} array The array to search. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @returns {n

(array, value, fromIndex)

Source from the content-addressed store, hash-verified

35302 * @returns {number} Returns the index of the matched value or `-1`.
35303 */
35304 function baseIndexOf(array, value, fromIndex) {
35305 var index = (fromIndex || 0) - 1,
35306 length = array ? array.length : 0;
35307
35308 while (++index < length) {
35309 if (array[index] === value) {
35310 return index;
35311 }
35312 }
35313 return -1;
35314 }
35315
35316 /**
35317 * An implementation of `_.contains` for cache objects that mimics the return

Callers 2

cacheIndexOfFunction · 0.85
indexOfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected