Can you describe this for me?
var arr, total;
arr = [1, 2, 3, 4, 5];
total = arr.reduce(function(previous, current) {
return previous + current;
});
// total
ReduceRight is different from reduce method as it starts computation on values from right to left.
Reference: http://www.thesstech.com/javascript/array_redcueright_method
Reduce Example:
Starting from left to right: 1*2 = 2*3 = 6 * 4 = 24
Ref:http://www.thesstech.com/tryme?filename=javascript_array_reduce_method
ReduceRight Example
Starting from right to left: 1024/256 = 4/4 = 1
Ref:http://www.thesstech.com/tryme?filename=javascript_array_reduceright_method