VulpesOS/gaia/apps/email/js/array.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

23 lines
548 B
JavaScript
Executable file

'use strict';
define(function(require) {
var array = {
/**
* @param {Array} array some array.
* @param {Function} callback function to test for each element.
* @param {Object} thisObject object to use as this for callback.
*/
indexOfGeneric: function(array, callback, thisObject) {
var result = -1;
array.some(function(value, index) {
if (callback.call(thisObject, value)) {
result = index;
return true;
}
});
return result;
}
};
return array;
});