Nice but still some caveats, from [0]:<p>Prototypes. If you use structuredClone() with a class instance, you’ll get a plain object as the return value, as structured cloning discards the object’s prototype chain.<p>Functions. If your object contains functions, they will be quietly discarded.<p>Non-cloneables. Some values are not structured cloneable, most notably Error and DOM nodes. It will cause structuredClone() to throw.<p>Web workers are patchy too.<p>[0] <a href="https://web.dev/structured-clone/" rel="nofollow">https://web.dev/structured-clone/</a>