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