Code Editor
Learn
Data Structures

Iterating Over a Hash

We've done a fair amount of iteration over arrays, so to finish up, let's review how to iterate over a hash.

numbers = [1, 2, 3, 4, 5] numbers.each { |element| puts element }
Report a Bug
If you see a bug or any other issue with this page, please report it here.