Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is great trick because the console will keep a reference to your object, not a copy, so if it changes between the time it was logged and now then the log expando shows the new value, not the old value.

By printing out the object you get a point-in-time snapshot rather than a reference to a mutable object.



Yup, learned it the hard way lol.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: