How can I convert a JavaScript object into a string?
Example:
var o = {a:1, b:2} console.log(o) console.log(\'Item: \' + o)
Output:
One option:
console.log('Item: ' + JSON.stringify(o));
Another option (as soktinpk pointed out in the comments), and better for console debugging IMO:
console.log('Item: ', o);