You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 25, 2022. It is now read-only.
As I'm sure you know, console.log doesn't print a snapshot of the variable at that time, which means that later code can change the result when you expand objects in a browser. I've seen various solutions to this, such as JSON.parse(JSON.stringify(value)), and I won't claim what is the best, but a proper dump function should definitely print objects exactly as they are at that moment in time.
The text was updated successfully, but these errors were encountered:
Because you're just passing a reference to an object to console.log. The reference itself does not change, however the browser will not evaluate the contents of the object until it is actually expanded, at which point its contents may have changed. This is a pretty common Javascript debugging issue.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
As I'm sure you know, console.log doesn't print a snapshot of the variable at that time, which means that later code can change the result when you expand objects in a browser. I've seen various solutions to this, such as
JSON.parse(JSON.stringify(value))
, and I won't claim what is the best, but a proper dump function should definitely print objects exactly as they are at that moment in time.The text was updated successfully, but these errors were encountered: