Instead of:
JSON.parse(JSON.stringify(obj))
Use:
structuredClone(obj);
Why
-
Preserves Dates, Maps, Sets
-
Faster
-
Safer
Daily micro-tips for C#, SQL, performance, and scalable backend engineering.
Instead of:
JSON.parse(JSON.stringify(obj))
Use:
structuredClone(obj);
Preserves Dates, Maps, Sets
Faster
Safer