Javascript Array contains(elem)
Array.prototype.contains = function(elem) { for (var i in this) {/*from w w w. ja va2 s. c om*/ if (this[i] == elem) return true; } return false; }