UNPKG

417 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3function findIndex(arr, predicate, fromIndex) {
4 if (fromIndex === void 0) { fromIndex = 0; }
5 for (var i = fromIndex; i < arr.length; i++) {
6 if (predicate(arr[i], i)) {
7 // 找到终止循环
8 return i;
9 }
10 }
11 return -1;
12}
13exports.default = findIndex;
14//# sourceMappingURL=find-index.js.map
\No newline at end of file