Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Asoth |
Hello everyone,
I was a bit upset the first time I discovered that concept of deep or shallow copy.
And I think I get it (bless the ones who implemented .duplicate(1)
)… but I still have really strange behaviour that are not supposed to happen (according to my little understanding)
instead of providing a sample of code and finding a hack or whatever to my particular case. Is there a safe/common practice about dealing with arrays
like:
never do this : …
try to always do this : …
(or any tutorial from different language )
because I don’t even know if I encountered a bug or expected behaviour and I am pretty sure that noob like me have same headache when dealing with array
thank you cheers