Ruby Ruby Loops Ruby Iteration The For Loop

for loop in Ruby

What am I missing?

for.rb
animals = ["dog", "cat", "horse", "goat"]
for animals.array item
  puts "The current item is #{item}."
end
end

1 Answer

I think the answer should be :

animals = ["dog", "cat", "horse", "goat"]
for  item in animals
  puts "The current item is #{item}."
end