I'm new to ruby and was wondering how I'd go about this
For example:
a = [1,2,3,4]
b = []
b.push(a)
a.pop
a.pop
print b
# => [[1,2]]
I was expecting b to remain [[1,2,3,4]]
a seems to be pushed into b by reference, rather than value. I'd like b to stay as it is regardless of what I do to a in the future; how do I go about doing this in Ruby?