:047 > aa= [{a: 1, b:2}, {c: 2, b: 2}] => [{:a=>1, :b=>2}, {:c=>2, :b=>2}] :048 > bb = aa.clone => [{:a=>1, :b=>2}, {:c=>2, :b=>2}] :049 > c=aa.group_by{|item| item[:b]} => {2=>[{:a=>1, :b=>2}, {:c=>2, :b=>2}]} :050 > c[2]=c[2].map{|x| x[:a] = 3;x} => [{:a=>3, :b=>2}, {:c=>2, :b=>2, :a=>3}] :051 > aa => [{:a=>3, :b=>2}, {:c=>2, :b=>2, :a=>3}] :052 > bb => [{:a=>3, :b=>2}, {:c=>2, :b=>2, :a=>3}]
如何避免 bb 的值被改变?