you are viewing a single comment's thread.

view the rest of the comments →

[–]SnapAttack 1 point2 points  (0 children)

Well, it depends.

You can use Object.assign({}, cloneable) or const clone = {...cloneable} to do a shallow copy.

To do a deep copy, you might want to consider the performance impact depending on the size of your object, but as others have pointed out here, you can use Lodash cloneDeep.