Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react json object pretty

var jsonObject = JSON.parse( jsonString ) // parse to object if necessary

<div>
  <pre> // defines preformatted text
  	{ JSON.stringify( jsonObject, null, 2 ) } // spacing level = 2
  </pre>
</div>
 
PREVIOUS NEXT
Tagged: #react #json #object #pretty
ADD COMMENT
Topic
Name
7+4 =