# reduce.rb def add a, b a + b end puts [1, 2, 3 , 4, 5].reduce{ |x, y| add x, y }