The global structuredClone() method deep clones a given value using the structured clone algorithm.


const clonedValue = structuredClone(value[, { transfer }]);



The value to be cloned. This can be any structured-clonable type.

transfer Optional

A sequence of objects that are transferred with value. The ownership of these objects is transfered from the input value to the cloned value that is returned.

Return value

The returned clonedValue is a clone of the original passed value, with transfered values for items passed in the transfer array.


This function can be used to deep copy JavaScript values. The structured clone algorithm also supports circular references. The below example demonstrates this:

// Create an object with a value and a circular reference to itself.
const original = { name: "MDN" };
original.itself = original;

// Clone it
const clone = self.structuredClone(original);

console.assert(clone !== original); // object are not the same (not same identity)
console.assert( === "MDN"); // they do have the same values
console.assert(clone.itself === clone); // and the circular reference is preserved


HTML Standard (HTML)
# dom-structuredclone

Browser compatibility

BCD tables only load in the browser

See also