linq.js
function count(predicate) {
  predicate = typeof predicate === 'function' ? predicate : util.defaultPredicate;

  let c = 0;

  for (let item of this) {
    if (predicate(item)) c++;
  }

  return c;
}
function count(predicate) {
  predicate = typeof predicate === 'function' ? predicate : util.defaultPredicate;

  let c = 0;

  for (let item of this) {
    if (predicate(item)) c++;
  }

  return c;
}
function count ( predicate ) { predicate = typeof predicate === 'function' ? predicate : util . defaultPredicate ; let c = 0 ; for ( let item of this ) { if ( predicate ( item ) ) c ++ ; } return c ; }
Returns a number that represents how many elements in the specified sequence satisfy a condition.

@param {(Function)} predicate The condition for compute item counts
@return Return the count which satisfy a condition.
Returns a number that represents how many elements in the specified sequence satisfy a condition .