structuredClone() has been around for a bit now but it still shows undefined in the editor. Is this a something the retool team can fix.
Also what is best practice?:
if i have a variable in my app that holds data. And i have a js query that references that variable and i then modify it for to then upload in a different variable should i be making a copy of it with structuredClone() or JSON.parse(JSON.stringify()).
JSON.parse(JSON.stringify()) works well for plain data types (objects and arrays containing only JSON-serializable data types: string, number, object, array, true, false, null), but does not work well with objects containing functions, Date objects, or non-JSON-serializable values.
structuredClone() preserves functions, Date objects, and other non-JSON-serializable values as it's designed for cloning structured data, including more complex objects. With that said, there may be limited browser support for this method.