Skip to content

deepClone

deepClone(object) → object · Object

Create a deep (recursive) copy of an object. Modifications to the clone do not affect the original.

  • object (required): the object to clone
utlx
let original = {nested: {value: 42}}
let copy = deepClone(original)
// copy is a fully independent copy — no shared references
{
  cloned: copy    // {nested: {value: 42}}
}

Released under AGPL-3.0.