Check out example codes for "iterate over array ruby". It will help you in understanding the concepts better.

Code Example 1

# For Ruby
arr = ['a', 'b', 'c']

arr.each do |item|
  puts item
end

Code Example 2

# For Ruby
arr = ['a', 'b', 'c']

arr.each { |item| puts item }

Learn ReactJs, React Native from akashmittal.com