Bug 861277 - Uplift addon-sdk's integration branch
This commit is contained in:
@@ -101,3 +101,15 @@ function fromIterator(iterator) {
|
||||
return array;
|
||||
}
|
||||
exports.fromIterator = fromIterator;
|
||||
|
||||
|
||||
function find(array, predicate) {
|
||||
var index = 0;
|
||||
var count = array.length;
|
||||
while (index < count) {
|
||||
var value = array[index];
|
||||
if (predicate(value)) return value;
|
||||
else index = index + 1;
|
||||
}
|
||||
}
|
||||
exports.find = find;
|
||||
|
||||
Reference in New Issue
Block a user