Javascript Array has(elem)

Description

Javascript Array has(elem)

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

Javascript Array has(elm)


Array.prototype.has = function(elm) {
  return~~ this.indexOf(elm);
};



PreviousNext

Related