News for hackers. Stuff that matters.
Re:Copying objects in JavaScript by simlevesque on Tuesday November 13, 2018 @01:11PM (#18443199)
I did not say that JSON.parse would parse the dates.

I'm saying that the article is wrong when it says that JSON.stringify does not transform Dates into ISO string.

Right after that, the article says "cannot be parsed back to its original value" when it definitely can be parsed back. JSON.parse does not do it by default but that was never his point.

Re:Copying objects in JavaScript by twblalock on Tuesday November 13, 2018 @06:22PM (#18445845)
> Right after that, the article says "cannot be parsed back to its original value" when it definitely can be parsed back. JSON.parse does not do it by default but that was never his point.

The broader point, which is entirely correct, is that you don't get back an exact copy of the object you want to clone, because the date fields don't end up being the same type.