This website uses Cookies. Click Accept to agree to our website's cookie use as described in our Privacy Policy. Click Preferences to customize your cookie settings.
Hello, I am struggling to flatten out some JSON. I looked at a bunch of the examples and did my best to figure it out but still having no luck.
Below is what I am looking for.
Current:
[
{
"items": {
"item1": {
"1": "i1_1",
...
Decided to go the JavaScript route. It’s not pretty but it seems to works.
JavaScript:
const json = '[{"items": {"item1": {"1": "i1_1","2": "i1_2"}, "item2": {"1": "i2_1","4": "i2_2","6": "i2_3"}, "item3": {"5": "i3_1"}}}]';
var myArr1 = JSON.parse(...