Javascript Array every(iterator)

Description

Javascript Array every(iterator)


Array.prototype.every = function(iterator) {
  for (var i = 0, len = this.length; i < len; i++) {
    if (!iterator(this[i], i)) {
      return false;
    }/*  w w  w .  ja va2  s. com*/
  }
  
  return true;
};



PreviousNext

Related