List of utility methods to do Array Count
first_n(count)Array.prototype.first_n=function(count) { var a=[]; for(var i=0;i<count;i++) { a.append(this[i]); return a; | |
valueCount(value)Array.prototype.valueCount = function (value) { var count = 0; for( var i = 0; i < this.length; i++) { if ( this[i] === value) { count++; }; }; return count; }; ... | |
valueCount(value)Array.prototype.valueCount = function (value) { var count = 0; for( var i = 0; i < this.length; i++) { if ( this[i] === value) { count++; }; }; return count; }; ... |