Answers for "add key and value to first spot in hash ruby"

0

add key and value to first spot in hash ruby

hash1 = { two: 2, three: 3 }

#add a new key,value 
hash1 = Hash[:one,1].merge!(hash1) #=> {:one=>1, :two=>2, :three=>3}
Posted by: Guest on January-10-2022

Code answers related to "add key and value to first spot in hash ruby"

Browse Popular Code Answers by Language