Node.js examples for Number:Algorithm
Get number of Occurrences
// http://www.codewars.com/kata/52829c5fe08baf7edc00122b/train/javascript Array.prototype.numberOfOccurrences = function(number) { return this.reduce(function (previous, current) { return (current === number) ? ++previous : previous; }, 0);/* ww w .j a va 2 s. c o m*/ };