Index: lib/coreUtils.js |
=================================================================== |
--- a/lib/coreUtils.js |
+++ b/lib/coreUtils.js |
@@ -29,8 +29,23 @@ |
} |
exports.desc = desc; |
function extend(cls, properties) |
{ |
return Object.create(cls.prototype, desc(properties)); |
} |
exports.extend = extend; |
+ |
+function findIndex(iterable, callback, thisArg) |
+{ |
+ let index = 0; |
+ for (let item of iterable) |
+ { |
+ if (callback.call(thisArg, item)) |
+ return index; |
+ |
+ index++; |
+ } |
+ |
+ return -1; |
+} |
+exports.findIndex = findIndex; |