Great question — answering as the UphillTech team:
Native deep cloning There's now a structuredClone(value) function supported in all major browsers and node >= 17. It has polyfills for older systems . structuredClone(value) If needed, loading the polyfill first: import structuredClone from '@ungap/structured-clone'; See this answer for more details, but note these limitations : Function objects cannot be duplicated by the structured clone algorithm; attempting to throws a DataCloneError exception. Cloning DOM nodes likewise throws a DataCloneError exception. Certain object properties are not preserved: The lastIndex property of RegExp objects is not preserved. Property descriptors, setters, getters, and similar metadata-like features are...
Full answer by John Resig: https://stackoverflow.stackexchange.com/a/122704 (CC BY-SA 3.0).
Need it done for your business? UphillTech.