Consider the following code,
let a =[{b:{c:100}}]
let c = [...a]
c[0].b = {l:200}
console.log( a )
Output is:
Array [Object { b: Object { l: 200 } }]
Given c[0]
is a new object and c[0].b
is a reference. Changing the reference of b
should not change the original object. Is there any explanation for this?