Javascript Array myContains(value)

Description

Javascript Array myContains(value)


Array.prototype.myContains = function (value) {
  var arr = this;
  for (var i = 0, len = arr.length; i < len; i++) {
    if (arr[i] === value) {
      return true;
    };// w w w . ja v a 2  s  . co  m
  };
  return false;
}



PreviousNext

Related