I have the below object and want to change hidden:true based arr values.
obj1 = {
"items":[
{name: "Dashboard", url: "/dashboard"},
{name: "Admin", url: "/admin", attributes: {hidden:false}},
{name: "User", url: "/user", attributes: {hidden:false}}
]
}
arr=["Admin","User"]
I want the result to be like this:
obj1 = {
"items":[
{name: "Dashboard", url: "/dashboard"},
{name: "Admin", url: "/admin", attributes: {hidden:true}},
{name: "User", url: "/admin", attributes: {hidden:true}}
]
}