Iterating over an array in Ruby is one thing. Iterating over a multi-dimensional array in Ruby is another. Ruby presents an elegant way to iterate through an array using array.each {}
.
The process of iterating through a two-dimensional array is slightly different:
s.each { |sub_array| sub_array.each { |element| puts element }}
Top comments (0)