For each element in an array : in « Statement « Ruby






For each element in an array


for element in ['a', 'b', 'c']
  puts element
end
# a
# b
# c

 








Related examples in the same category

1.For each element in a range
2.Use for to loop through array index