Javascript Array in_array(needle)
Array.prototype.in_array = function(needle) { for (var i = 0; i < this.length; i++) if (this[i] === needle) return true;/*from w ww . j a va 2 s .com*/ return false; }