JSFiddle - React, Tailwind, and code Playground
by Alexander
JavaScript
console.clear();
const copy = obj => ({...obj});
let o1 = { foo: { bar: { baz: 123 }}}
let o2 = copy(o1);
o1.foo.bar = 123;
console.log(JSON.stringify(o1))
console.log(JSON.stringify(o2))