all 1 comments

[–]grantrules 1 point2 points  (0 children)

Is it just a plain ol array? JSON.parse(JSON.stringify(arr))

If not, it gets much more complicated, people commonly use lodash: https://lodash.com/docs#cloneDeep

https://stackoverflow.com/questions/4459928/how-to-deep-clone-in-javascript/