MCPcopy Index your code
hub / github.com/microsoft/SandDance / findIndex

Function findIndex

docs/app/js/sanddance-app.js:23237–23245  ·  view source on GitHub ↗
(array, cb, fromIndex)

Source from the content-addressed store, hash-verified

23235 * @returns True if the arrays are the same length and have the same values in the same positions, false otherwise.
23236 */ parcelHelpers.export(exports, "arraysEqual", ()=>arraysEqual);
23237function findIndex(array, cb, fromIndex) {
23238 if (fromIndex === void 0) fromIndex = 0;
23239 var index = -1;
23240 for(var i = fromIndex; array && i < array.length; i++)if (cb(array[i], i)) {
23241 index = i;
23242 break;
23243 }
23244 return index;
23245}
23246function find(array, cb) {
23247 var index = findIndex(array, cb);
23248 if (index < 0) return undefined;

Callers 1

findFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected