0

Sum up all values within an array using JavaScript reduceRight function

JavaScript
var sum = [0, 1, 2, 3].reduceRight(function(a, b) {
  return a + b;
});

console.log(sum); // 6
RUN
add comment
Suggest a different solution or add another example