Learn
We can also iterate over hashes using the .each
method. For example, we could do
my_hash.each do |key, value| puts my_hash[key] end
This will print out a list of values from my_hash
, each on its own line.
Instructions
1.
Iterate over the matz
hash and print each value to the console using puts
.
Take this course for free
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.