JavaScript Node.js Basics 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
163,049 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
163,049 Points

Glad i could help — happy coding!

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