Iterating Over Multidimensional Arrays


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

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

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


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