Here is my challenge.
a = ["1", "2"]
b = ["3", "4"]
a << b
a # => ["1","2",["3","4"]]
If I modify the value of b[0], a also is changed.
b[0] = "5"
a # => ["1","2",["5","4"]]
After pushing b into a, b was modified. Why is a changed, and how can I fix it?
%w(1 2 3 4)as the result. If I'm right, you can usea.push(*b), and in this way,awill not change withb.