if (typeof window.econda == 'undefined') {
var econda = window.econda = {};
}
if (typeof econda.util == 'undefined') {
econda.util = {};
}
/**
* Provides some helper functions for arrays
* @private
* @class econda.util.Array
*/
econda.util.Array =
{
/**
* Returns index of needle in array obj
*
* @method
* @param {Object} obj array to search in
* @param {Object/String/Number} needle array item to search for
* @return {Number} needle found at index or -1 if needle was not found
*/
indexOf : function(obj, needle) {
if (Array.prototype.indexOf) {
return obj.indexOf(needle);
} else {
for ( var n = 0; n < obj.length; n++) {
if (obj[n] == needle) {
return n;
}
}
return -1;
}
}
};