With arrays, you can use the each method to iterate through each element of the array.
You can do the same with hashes:
x = { "a" => 1, "b" => 2 } x.each { |key, value| puts "#{key} equals #{value}" }