print object javascript
snippet in javascript

print object javascript

user2680

str = JSON.stringify(obj);
str = JSON.stringify(obj, null, 4); // (Optional) beautiful indented output.
console.log(str); // Logs output to dev tools console.
alert(str); // Displays output using window.alert()

cosnsole.log without obj object

user4737

console.log(JSON.stringify(myObject, null, 4));