Komag
9 years agoRoku Guru
Is there way to copy an object instead of creating a reference?
If I have a variable A that is an array full of associative arrays, and I set B = A, it's just a reference
Even if I do FOR EACH element in A, B.Push(element), later when I mess around with the elements, I can still go into A and see the changes! So each element (each associative array) was just referenced, not copied.
How can I copy it, make a truly separate object?
Even if I do FOR EACH element in A, B.Push(element), later when I mess around with the elements, I can still go into A and see the changes! So each element (each associative array) was just referenced, not copied.
How can I copy it, make a truly separate object?