Node.js examples for Array:Array Operation
Array reduce from Right
Array.prototype.reduceRight = function reduceRight(callback, initialValue) { var array = this, previousValue = initialValue || 0; for (var index = array.length - 1; index > -1; --index) { previousValue = callback.call(window, previousValue, array[index], index, array); }//from w ww . ja v a 2s . c om return previousValue; };