9951 explained code solutions for 126 technologies
var obj = {a: 1, b: 2}; console.log( JSON.stringify(obj, null, 2) );ctrl + cyoutubegithub
var obj = {a: 1, b: 2}; console.log( JSON.stringify(obj, null, 2) );
var obj
declare test object to print
JSON.stringify
convert JSON to string (docs)
, 2)
will format JSON with 2-spaces indents