How to print only the last result in this array? ruby : I only want to print the last result of this operation, that would be 10. How I can do that?
    
    result = 0
    numbers = [1,2,3,4]
    numbers.map do |x|
    result + = x
        puts result
    end