Last active
May 10, 2019 19:14
-
-
Save stevewithington/d274fe2ce0ed8190fab13e1d7b1909a8 to your computer and use it in GitHub Desktop.
Prettify JSON, the easy way!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// arbitrary js object: | |
var myJsObj = {a:'foo', 'b':'bar', c:[false,2,null, 'null']}; | |
// using JSON.stringify pretty print capability: | |
var str = JSON.stringify(myJsObj, undefined, 4); | |
// Kudos: <https://stackoverflow.com/questions/26320525/prettify-json-data-in-textarea-input/26324037> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment