Slightly related: I die a little inside each time I see `JSON.parse(JSON.stringify(object))` thinking about the inefficiencies involved compared to how you'd do this in a more efficient language.
also depends on the codebase, if you use frameworks with deep reactivity like Vue, you can't do structuredClone without toRaw (which only works if the object is shallow) as it'd throw on proxy objects.
Svelte has `$state.snapshot()` for this reason I believe.
There's structuredClone (https://developer.mozilla.org/en-US/docs/Web/API/Window/stru... https://caniuse.com/?search=structuredClone) with baseline support (93% of users), but it doesn't work if fields contain DOM objects or functions meaning you might have to iterate over and preprocess objects before cloning so more error-prone, manual and again inefficient?