Javascript Array numberOfOccurrences(chr)

Description

Javascript Array numberOfOccurrences(chr)




Array.prototype.numberOfOccurrences = function(chr) {
  return this.filter(function(x){ return x == chr; }).length;
}



PreviousNext

Related