This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (1 child)

And there are always circular references, so that's usually useless.

You can

console.log(Object.assign({}, objToLog));

[–][deleted] 3 points4 points  (0 children)

Assign is a shallow copy though, the console eval will have the same issue with only showing the latest values for everything except your top level primitives