could you tell me how to iterate through the desired data in the following array? Take out the name and id from the following array and put them in an array of objects; arrNew = [{id:1, name: "system Settings"}, {id:39, name: "menu Management"}, {id:36, name: "menu details"},.]
let arr = [
{
"appId":1001,
"id":1,
"name":"",
"nodes":[
{
"appId":1001,
"id":38,
"name":"",
"nodes":[
{
"appId":1001,
"id":36,
"name":"",
}
]
},
{
"appId":1001,
"id":2,
"name":"",
"nodes":[
]
},
]
},
{
"appId":1001,
"id":439,
"name": ""
"nodes":[
{
"id":440,
"name":"",
"nodes":[
]
}
]
}
];
mainly hope to get a more efficient method.