Ruby itérer sur le tableau
# For Ruby
arr = ['a', 'b', 'c']
arr.each do |item|
puts item
end
Bewildered Buffalo
# For Ruby
arr = ['a', 'b', 'c']
arr.each do |item|
puts item
end
array = [1, 2, 3, 4, 5, 6]
array.each { |x| puts x }
numbers = [0, 1, 2, 3]
for element in numbers do
puts element
end
# For Ruby
arr = ['a', 'b', 'c']
arr.each { |item| puts item }