📜  javascript print object pretty - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:01.398000             🧑  作者: Mango

代码示例1
//Prototype JSON.stringify(value[, function [, space]])
var myObject = {"hello": "world", "!": []};
var str = JSON.stringify(myObject, null, '\t');//space may be a string or a number corresponding to the number of space

//What is displayed in the console
{
    "hello": "world",
    "!": [] 
}