Here you can find the source of first_n(count)
Array.prototype.first_n=function(count) { var a=[];/* www. java2 s. c om*/ for(var i=0;i<count;i++) { a.append(this[i]); } return a; }
Array.prototype.countForBreeding = function() { var numToBreed = 0; for (var i = 0; i < this.length; i++) { if (this[i].noCalvesYet()) { numToBreed++; return numToBreed; }; ...
Array.prototype.countItem = function (item) { return this.filter(function (i) { return i === item }).length; };
Array.prototype.countOf = function (pValue){ var count = 0; var lArray = this || []; var lLength = lArray.length for (var i = 0 ; i < lLength; i++){ if (lArray[i] == pValue){ count++; return count;
Array.prototype.countType = function (type) { var count = 0 for( var i = 0, x = this.length; i < x; i++) { if (this[i] === type) { count++ return count
Array.prototype.element_count = function(){ var count = 0; for(var i=0; i<this.length; i++){ if(this[i] != undefined){ count++; return count;
Array.prototype.valueCount = function (value) { var count = 0; for( var i = 0; i < this.length; i++) { if ( this[i] === value) { count++; }; }; return count; }; ...
Array.prototype.valueCount = function (value) { var count = 0; for( var i = 0; i < this.length; i++) { if ( this[i] === value) { count++; }; }; return count; }; ...