Iterating Over Multidimensional Arrays


#1

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

s.each do | sub_array |
sub_array.each do | y |
puts y
end
end

I’m following all of this except for the “y” - what does it mean and how is it exporting everything from the multidimensional array?


#2

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