How do you log content of a JSON object in Node.js?

Is it possible to print an objects contents e.g. methods and attributes in Node.js?

At the moment I’m trying to print the session object and get the following:

console.log("Session:" + session);
> Session:[object Object]

Maybe in a similar way to print_r(array) in PHP, or using .toString in Java.

8 Answers
8

Leave a Comment