What is the difference between `Array.prototype.reduceRight()` and `reduce()`?

JavaScript Professional Medium

JavaScript Professional — Medium

What is the difference between `Array.prototype.reduceRight()` and `reduce()`?

Key points

  • `reduceRight()` iterates right-to-left, `reduce()` left-to-right
  • Direction affects result for non-commutative operations
  • Both methods accumulate a value during iteration

Ready to go further?

Related questions