JavaScript tips — Pretty print json strings with JSON.stringify

preview_player
Показать описание
Want to create easier to read json strings? Try the third argument to JSON.stringify. This specifies the number of spaces for each indent level in the resulting json string

JSON.stringify(myObject, null, 4) for example adds newlines between properties and indents each by 4 spaces

#javascript #json
Рекомендации по теме