iterate over ruby array code example
Example 1: ruby iterate over array
# For Ruby
arr = ['a', 'b', 'c']
arr.each do |item|
puts item
end
Example 2: ruby each do method
numbers = [1,2,4,9,12]
numbers.each do |n|
break if n > 10
puts n
end