Answers for "ruby hash get value by key"

0

ruby get key

hash = {"apple" => "fruit", "carrot" => "vegetable"}
array = hash.keys   #=> ["apple", "carrot"]
Posted by: Guest on January-20-2021
-1

get specific key value from array of hashes in ruby

values = ary.map{|h| h[13]}.compact
Posted by: Guest on July-29-2020

Browse Popular Code Answers by Language