Check out example codes for "ruby how to loop through an array". It will help you in understanding the concepts better.

Code Example 1

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

arr.each { |item| puts item }

Code Example 2

array = [1, 2, 3, 4, 5, 6]
array.each { |x| puts x }

Learn ReactJs, React Native from akashmittal.com