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; };
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; };