Hacker News new | ask | show | jobs
by shanghaikid 911 days ago
For data to rendering on UI, JSON.parse(JSON.stringify()) is enough. For other operations, clone an object with such complex structure is not a good idea, you may change your way of coding.
1 comments

Agreed, generally. But it may be nice for saving complicated game states, or sending complicated objects to a Worker without having to rebuild them from JSON.