Today, I was working with redux.
When I was creating a copy with Object.assign with objects without inner arrays, it worked well.
But when I had to deal with an object like this:
{
ID:'2',
NAME:'GENERAL',
FIELDS:[
{
ID:'1',
NAME:'M2'
}
]
}
, Object assign would make a copy, but the changes that I made in the copy were happening in the original too.
I have to use lodash cloneDeep.
Anyone knows why this behaviour happens?