I have the following JSON:
"menu":[
{
"name": "Home",
"icon": "ri-home-4-line",
"layoutCode": "",
"active": ["h1"]
},
{
"name": "Cust",
"layoutCode": "",
"icon": "ri-user-2-fill",
"active": ["c1", "c2"]
}
]
What I would like to do is filter by active and get the parent object.
I tried with this:
json_menu.menu.filter(record => record.active === 'c1')
but i obtain an empty object.