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.
let d = new Date(); let s = JSON.parse(JSON.stringify(d));
s will not be a clone of d.