user6064424
user6064424

Reputation:

Output string and object in a single console.log

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?

Upvotes: 1

Views: 4729

Answers (1)

cookies
cookies

Reputation: 333

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

Upvotes: 2

Related Questions