Javascript ES6 console.log object using template literal
You could serialize the object with JSON.stringify
.
var obj = { name: 'John', age: 22 };
console.log(`my object is: ${JSON.stringify(obj)}`);
You could serialize the object with JSON.stringify
.
var obj = { name: 'John', age: 22 };
console.log(`my object is: ${JSON.stringify(obj)}`);