3 ms·
I'd like to see how object duplication now compares in speed when using JSON.parse(JSON.stringify()) vs. recursive duplication.
by 65 1y ago
I'd like to see how object duplication now compares in speed when using JSON.parse(JSON.stringify()) vs. recursive duplication.
- Cthulhu_ 1y agoAlso take `structuredClone()` in this comparison; I don't understand why parse/stringify is still a thing, it's a workaround. I'm sure there can be a special code path to make this particular use case super fast or infer that it needs to create a full copy of an object, but there shouldn't be one.