How to save the output of a console.log(object) to a file?

后端 未结 9 1299
情深已故
情深已故 2020-11-28 00:14

I tried using JSON.stringify(object), but it doesn\'t go down on the whole structure and hierarchy.

On the other hand console.log(object) d

9条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-28 00:46

    You can use the Chrome DevTools Utilities API copy() command for copying the string representation of the specified object to the clipboard.

    If you have lots of objects then you can actually JSON.stringify() all your objects and keep on appending them to a string. Now use copy() method to copy the complete string to clipboard.

提交回复
热议问题