News for hackers. Stuff that matters.
Re:Deep Cloning Objects in JavaScript, the Modern Way by chatmasta on Thursday December 21, 2023 @07:11PM (#38729047)
Yep. But API calls traverse the network, and assuming that's via JSON, you're already losing functionality like Date parsing, so the litmus test of JSON.stringify/parse seems appropriate to determine if you're dealing with a true "data object." If you run into issues with things like Dates, then it's a smell indicating a potential point of divergence in different codepaths that handle the network call differently.
Re:Deep Cloning Objects in JavaScript, the Modern Way by endisneigh on Thursday December 21, 2023 @07:16PM (#38729084)
I don’t disagree, but just responding to your comments first paragraph.