5 ms·
I agree that its weirdly difficult but if you are trying to deep clone an object, you are probably doing something wring
by rabbits_2002 3y ago
I agree that its weirdly difficult but if you are trying to deep clone an object, you are probably doing something wring
- WA 3y agoNot at all. It’s common to have nested data, it can be quite simple, but still nested. Think: config objects, simple state objects. I want my functions to be pure. Instead of modifying the nested object, they should return a modified deep copy.
- lambda_garden 3y agoUse the spread syntax to make a shallow copy; it's more performant.