Last active
March 6, 2023 15:58
-
-
Save mandrasch/260f620c3b0d8003aec2d3ec18c44ea6 to your computer and use it in GitHub Desktop.
JSON.stringify with nested objects
This file contains hidden or 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
var o1 = [{ | |
"name":"string", | |
"active":"bool", | |
"data":[{ | |
"value":"number", | |
"date":"string" | |
},{ | |
"value":"number2", | |
"date":"string2", | |
"children":[ | |
{"test":"123"}, | |
{"test":"456"} | |
] | |
}] | |
}]; | |
JSON.stringify(o1); | |
// output: | |
// '[{"name":"string","active":"bool","data":[{"value":"number","date":"string"},{"value":"number2","date":"string2","children":[{"test":"123"},{"test":"456"}]}]}]' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment