Javascript Array countForBreeding()

Description

Javascript Array countForBreeding()


Array.prototype.countForBreeding = function() {
  var numToBreed = 0;
  for (var i = 0; i < this.length; i++) {
    if (this[i].noCalvesYet()) {
      numToBreed++;/* w  w w  . jav  a 2 s .com*/
    }
  }
  
  return numToBreed;
};

Javascript Array countForBreeding()

Array.prototype.countForBreeding = function(){
  var numToBreed = 0;
  for (var i = 0; i < this.length; i++) {
    if (this[i].noCalvesYet()) {
      numToBreed++;/*from  www. ja  v a  2s  . co  m*/
    }
  }
  return numToBreed;
};



PreviousNext

Related