Answer the question
In order to leave comments, you need to log in
How to assign one array to another in Ruby (so that they are different objects)?
There are for example arrays:
list = [1,2,3]
I create an array list2 =[] I
assign list2 << list
I delete an element from the array list2.delete(1)
This element is also deleted in list.
As I understand it, you need to use Marshal.dump here, but I tried it - it doesn't work.
How to solve the problem?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question