Last Updated: April 12, 2022
·
1.075K
· deteam

Ruby Inline Array Sum using reduce

> [1, 2, 3].reduce(:+)
=> 6 

same for mult.:

> [1, 2, 3, 4].reduce(:*)
=> 24