J
Jason Lillywhite
how would I do stuff to each value of a hash and return a modified hash?
h = {"a"=> 3, "b"=> 5}
multiply each value by 2 and return
h = {"a"=> 6, "b"=> 10}
this does what I need but does not modify the hash
h.each {|k,v| h[k]*2}
h = {"a"=> 3, "b"=> 5}
multiply each value by 2 and return
h = {"a"=> 6, "b"=> 10}
this does what I need but does not modify the hash
h.each {|k,v| h[k]*2}