Skip to main content
You can add the numbers in the array [6,7,29] using a loop.
An alternative:
a = [6,7,29] puts a.inject(0){|b,i| b+i}
test text