Get in touch

Send an email to: lammers@gmail.com.
Or find me online at: Github, X

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