News for hackers. Stuff that matters.
Re:Copying objects in JavaScript by freeopinion on Tuesday November 13, 2018 @01:13PM (#18443229)
JSON.parse of an ISO string yields a string, not a date.

let d = new Date(); let s = JSON.parse(JSON.stringify(d));

s will not be a clone of d.

Re:Copying objects in JavaScript by simlevesque on Tuesday November 13, 2018 @01:17PM (#18443278)
I never said that JSON.parse yields a date by default. But it can.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

The article says it does not return a ISO string. I'm saying it does. The author as agreed with me and will update the article.