News for hackers. Stuff that matters.
Re:Deep Cloning Objects in JavaScript, the Modern Way by dylan604 on Thursday December 21, 2023 @08:03PM (#38729548)
to be honest, my experience with logging objects is so simple, i've never needed to try this live look into the object. my expectation was the log is a snap shot in time, not a live look at the object. an interactive view into the object does sound interesting rather than constant log entries for each step. which is how I would have tried to do something the first time only to be confused by it. TIL.
Re:Deep Cloning Objects in JavaScript, the Modern Way by jholman on Thursday December 21, 2023 @10:19PM (#38730584)
What the parent posts are trying to hint to you is that the default logging behaviour of the console is the live-look model, which is almost never what you wanted with logging. (Though it does have other uses.) To avoid the live-look, you can deep clone, or just stringify.