Javascript Array in_array(entity)
Array.prototype.in_array = function(entity) { for (var idx in this) { if (this[idx] === entity) return true; }//from w ww. j a v a 2 s. com return false; };