javascript display json pretty code example
Example 1: js json_encode pretty
var str = JSON.stringify(obj, null, 2); // spacing level = 2
Example 2: json.stringify pretty
JSON.stringify(obj, null, 2);
var str = JSON.stringify(obj, null, 2); // spacing level = 2
JSON.stringify(obj, null, 2);