Here is a JSON example that I am working with:
{
"MyTest:": [{
"main": {
"name": "Hello"
},
"test2": {
"test3": {
"test4": "World"
},
"test5": 5
}
},
{
"main": {
"name": "Hola"
},
"test6": [{
"name": "one"
},
{
"name": "two"
}
]
}
]
}
My goal is to convert it into an array of arrays with key-value pairs.
[[main.name: "Hello", test2.test3.test4: "World", test2.test5: 5] ,
[main.name = "Hola", test6.name: "one", test6.name: "two"] ];
I am looking for a function like "is leaf" that can help me identify the values in the JSON structure.
If you have any advice on how to iterate deeply through this data, please share as it would be greatly appreciated.