Javascript Array indexOf(obj, start)
Array.prototype.indexOf = function(obj, start) { for (var i = (start || 0), j = this.length; i < j; i++) { if (this[i] === obj) { return i; } }/* ww w.j a va 2 s . c o m*/ return -1; };