DEV Community

Calvin
Calvin

Posted on

1

Reading Snippets [53 => Ruby] ๐Ÿ’Ž

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 }}

Codecademy Ruby Course

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

๐Ÿ‘‹ Kindness is contagious

Please leave a โค๏ธ or a friendly comment on this post if you found it helpful!

Okay