Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

ruby map hash

hash = { bacon: "protein", apple: "fruit" }

hash.map { |k,v| [k, v.to_sym] }.to_h
# {:bacon=>:protein, :apple=>:fruit}
Source by www.rubyguides.com #
 
PREVIOUS NEXT
Tagged: #ruby #map #hash
ADD COMMENT
Topic
Name
6+5 =