As I know spread operator return a new object after operation:
let a = {a:1};
let b = {a: 2}
let a = {...a,...b}
So, last a
is not referenced to a
, it is a new object in memory.
Is it possible to use spread operator without changing initial object, I mean a reference in memory?