Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Node.js Basics 2017 Building a Command Line Application Parsing JSON

I see no result difference using console.log vs console.dir

Hi all!

I'm a new teamtree student delighted to have found this great place for studies.

My question: When I printout the result from a data callback, I don't see any difference using console.log or console.dir. It seems to be identical json result?

2 Answers

Steven Parker
Steven Parker
231,269 Points

Back in May, someone asked a similar question, and I said;

In the past, the behavior was quite different, particularly when logging object contents, but I've noticed that newer JavaScript engines have expanded the functionality of "console.log" so there isn't much different from "console.dir" anymore.

Ok, many thanks!

Steven Parker
Steven Parker
231,269 Points

Glad i could help — happy coding!

Ah ok; marked "best answer" now, happy coding to you too:-)