console log only prints object code example
Example 1: print object javascript
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()
Example 2: cosnsole.log without obj object
console.log(JSON.stringify(myObject, null, 4));