Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
23 lines
548 B
JavaScript
Executable file
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;
|
|
});
|