Nodejs Array Count Predicate countWhere(xAndY)

Here you can find the source of countWhere(xAndY)

Method Source Code

Array.prototype.countWhere = function(xAndY){
   var count = 0;
   for(var i = 0; i < this.length; i++)
   {/*ww  w .j a va 2s .c o m*/
      if(xAndY(this[i])){
         count++;
      }
   }
   return count;
}

Related

  1. countWhere(xAndY)
    Array.prototype.countWhere = function(xAndY){
      var count = 0;
      for(var i = 0; i < this.length; i++)
        if(xAndY(this[i])){
          count++;
      return count;
    ...