structuredClone()
noun
say it: “STRUK-churd KLOHN” /ˈstrʌktʃərd kloʊn/
A built-in JavaScript function that makes a full, deep copy of a value, so even the arrays and objects inside it are copies and nothing is shared.
What does structuredClone() do in JavaScript?
structuredClone() — A function that makes a deep copy of many built-in JavaScript values.
const copiedOrder = structuredClone(order);
In a sentence
- “I used structuredClone(pet) so adding a toy to the copy left the original pet's toys alone.”
Level: Freelancer · More JavaScript terms at this level
Updated