In the array to object, if one of your array items is an object then I believe the nested object will only be a pointer to the original object. If you need a brand new copy then you will need to spread the value using acc.push(...cur.value)
If the new object contains its own nested objects, even in the new object these will be pointers to the originals. Deep (recursive) cloning is difficult and expensive. The lodash library has deep cloning functions
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
In the array to object, if one of your array items is an object then I believe the nested object will only be a pointer to the original object. If you need a brand new copy then you will need to spread the value using acc.push(...cur.value)
If the new object contains its own nested objects, even in the new object these will be pointers to the originals. Deep (recursive) cloning is difficult and expensive. The lodash library has deep cloning functions