Live data from Hacker News

Which is the best method for deep cloning in JavaScript?

medium.com

61–62 of 62 posts

Re: Which is the best method for deep cloning in JavaScript?

#61
> This study does not contemplate shallow cloning or performance.

Hmm?

> cloneJSON is very slow and can’t do much. Please avoid it.

I always thought that javascript is fast at JSON parsing. Atleast the benchmark shows nice results: https://www.measurethat.net/Benchmarks/Show/18541/0/jsonstri...

Re: Which is the best method for deep cloning in JavaScript?

#62

Earlier quoted context omitted.

So how do you manipulate ISO dates as strings?

Although ISO date strings can be fairly trivial to read and manipulate with RexExp or a custom parser, depending on the complexity of the task, I would recommend using something like iso-fns. https://iso-fns.org It's too bad this library (and approach) never took off, but it's there to use nevertheless. Even without iso-fns, it's not as if mid level developer can't figure out how to write a function to perform a spec…

ISO datetimes are not monotonic. That’s already one good reason not to use them for storage.
Post reply on HN