1. 程式人生 > >How to output Object Data from Chrome console.log « 關於網路那些事...

How to output Object Data from Chrome console.log « 關於網路那些事...

var myObject = Data.toJSON();
console.log(myObject);

If we just right click and save console object, something will wrong as fellowing

script.js:393 (64805) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, …]

Just stringify your object, console and save again

It's will work

var myObject = JSON.stringify(myObject);
var myObject2String = JSON.stringify(myObject);
console.log(myObject2String);

如果你喜歡我們的文章內容,請在這裡按個讚