1

I am using node.js.

rows is an object. I want to see the contents of the object.

console.log("Contents of rows: ");
console.log(rows);

The above code works. Then, I took a short-cut and use

console.log("Contents of rows: " + rows);

Now, this does not work. Is it possible to have the above work in a single line?

2
  • 1
    Use console.log("Contents of rows: ", rows);. By concatenating an object, the object is converted into a string. Commented Apr 12, 2016 at 2:26
  • 1
    Hey! that's the answer! Why don't you put it down as the answer and let me give you points? Commented Apr 12, 2016 at 2:28

1 Answer 1

2

console.log("String", objects, arrays);

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.