Looking to extract using JavaScript: {"subNav0", "subNav1", "subNav2", "subNav3", "subNav4", "subNav5"}.
This is my JSON data:
const jsonData = {
"menus":{
"GrandparentNav0":{
"name":"TopNav",
"items":[
{
"name":"ParentNav0",
"iconClass":"",
"items":[
{
"name":"ParentNav1",
"iconClass":"",
"items":[
{
"name":"subNav0",
"iconClass":""
},
{
"name":"subNav1",
"iconClass":""
},
{
"name":"subNav2",
"iconClass":""
},
{
"name":"subNav3",
"iconClass":""
},
{
"name":"subNav4",
"iconClass":""
},
{
"name":"subNav5",
"iconClass":""
}
]
},
]
}
]
}
},
};
I have knowledge of basic array filtering:
jsonData.forEach(function(o) {
o.variable = o.variable.filter(s => s.value == value);
});
Unsure how to access menus from GrandparentNav0 in order to extract the subNav(s)