12. iterating multidimensional arrays


#1



12. iterating multidimensional arrays


I got stuck on this exercise. I found this code on the forum, however where we take the values |list| and |ing|
Please, can somebody explain?

Thanks!


s = [["ham", "swiss"], ["turkey", "cheddar"], ["roast beef", "gruyere"]]

s.each do | list |
list.each do | ing |
puts "#{ing}"
end
end


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.