Answers for "ruby hash foreach"

0

ruby hash.each

# iterating_over_hashes.rb

person = {name: 'bob', height: '6 ft', weight: '160 lbs', hair: 'brown'}

person.each do |key, value|
  puts "Bob's #{key} is #{value}"
end
Posted by: Guest on July-30-2021

Browse Popular Code Answers by Language