Looking for guidance on converting a nested object into a multidimensional array.
[{
"name": "level1",
"subCategory": [{
"name": "level2",
"subCategory": [{
"name": "level3",
"val": 1,
"subCategory": null
}]
}]
}, {
"name": "level1",
"subCategory": [{
"name": "level2",
"subCategory": [{
"name": "level3",
"val": 2,
"subCategory": null
}]
}]
}, {
"text": "level1",
"subCategory": [{
"name": "level2",
"subCategory": [{
"name": "level3",
"val": 3,
"subCategory": null
}]
}]
}]
Transforming it to:
[
["level1", "level2", "level3", 1]["level1", "level2", "level3", 2],
["level1", "level2", "level3", 3]
]