pretty-print JSON using JavaScript

后端 未结 24 1663
一向
一向 2020-11-21 06:45

How can I display JSON in an easy-to-read (for human readers) format? I\'m looking primarily for indentation and whitespace, with perhaps even colors / font-styles / etc.

24条回答
  •  清酒与你
    2020-11-21 07:05

    It works well:

    console.table()
    

    Read more here: https://developer.mozilla.org/pt-BR/docs/Web/API/Console/table

提交回复
热议问题