Javascript Array has(elem)
Array.prototype.has = function(elem) { return this.indexOf(elem) !== -1; };
Array.prototype.has = function(elm) { return~~ this.indexOf(elm); };