JavaScript
Deep cloning in JavaScript
JavaScript now provides a native function called structuredClone()
to make deep copies of objects.
const original = {
foo: 'foo',
bar: {
baz: 'baz',
},
}
const clone = structuredClone(original)
See MDN for more details