Live objects in Chrome’s console.log

It’s quite well known that passing an object in JavaScript passes a memory reference.

It turns out when logging nested objects to the console in Chrome, Chrome logs the reference to any nested objects rather than taking a deep snapshot. Which can make debugging more difficult, to say the least.

console-log-odd

Published by Peter Wilson

Peter Wilson is a Senior WordPress Engineer at Human Made and contributor to WordPress core. Peter has worked on the web for twenty years on everything from table based layouts in the 90s to enterprise grade CMS development. Peter’s a big fan of musical theater and often encourages his WordPress community colleagues to join him for a show or two in New York or in the West End.

Join the Conversation

2 Comments

Leave a comment

Your email address will not be published. Required fields are marked *