Skip to content

Instantly share code, notes, and snippets.

@lmzach09
Created July 27, 2019 04:21
Show Gist options
  • Save lmzach09/1419183c6f59349ba4d38326cee0270f to your computer and use it in GitHub Desktop.
Save lmzach09/1419183c6f59349ba4d38326cee0270f to your computer and use it in GitHub Desktop.
Stringify a JS object to JSON string with tab formatting
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