T
Tiggerius
keys = ["1", "2", "3", "4", "5"]
vals = ["a", "b", "c", "d", "e", "f", "g"]
I want h = {"1"=>"a", "2"=>"b", "3"=>"c", "4"=>"d", "5"=>"e"}
right now I do it by:
for i in 0..keys.size-1
h[keys]=vals
end
is there a ruby way, more slick way of doing this? Thanks.
vals = ["a", "b", "c", "d", "e", "f", "g"]
I want h = {"1"=>"a", "2"=>"b", "3"=>"c", "4"=>"d", "5"=>"e"}
right now I do it by:
for i in 0..keys.size-1
h[keys]=vals
end
is there a ruby way, more slick way of doing this? Thanks.