json.stringify pretty code example
Example 1: json stringify pretty
JSON.stringify(jsonobj,null,'\t')
Example 2: JSON.stringify pretty
var str = JSON.stringify(obj, null, 2); // spacing level = 2
Example 3: json.stringify pretty
var str = JSON.stringify(obj, null, 2); // spacing level = 2
Example 4: Javascript object to JSON string
var person={"first_name":"Tony","last_name":"Hawk","age":31};
var personJSONString=JSON.stringify(person);
Example 5: json.stringify pretty
JSON.stringify(obj, null, 2);