Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

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
Source by launchschool.com #
 
PREVIOUS NEXT
Tagged: #ruby
ADD COMMENT
Topic
Name
2+4 =