Created
July 27, 2019 04:21
-
-
Save lmzach09/1419183c6f59349ba4d38326cee0270f to your computer and use it in GitHub Desktop.
Stringify a JS object to JSON string with tab formatting
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
let obj = { "key": "value" }; | |
let myString = JSON.stringify(obj, null, '\t'); // tab | |
console.log(myString); | |
// { | |
// "key": "value" | |
// } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment