Pramod M

Pramod M

  • NA
  • 81
  • 9.7k

remove obj unmatched obj from array

Mar 9 2020 6:38 AM
[0:{app:"xyz",appId:"123"appfunctions:[0:{name:"tr",class:"12",Ismenu:"Y"},
1:{name:"tr",class:"12",Ismenu:"N"},2:{name:"tr",class:"123",Ismenu:"N"}]
},
0:{app:"abc",appId:"1234"appfunctions:[0:{name:"tsr",class:"12",Ismenu:"N"},
1:{name:"tr",class:"12",Ismenu:"N"},2:{name:"tr",class:"123",Ismenu:"Y"}]
},
0:{app:"test",appId:"123"appfunctions:[0:{name:"ter",class:"12",Ismenu:"Y"},
1:{name:"tsr",class:"12",Ismenu:"N"},2:{name:"tsr",class:"123",Ismenu:"N"}]
} ]
 
i need ismenu="Y" in child node with respect to parent
 
[0:{app:"xyz",appId:"123"appfunctions:[0:{name:"tr",class:"12",Ismenu:"Y"}]
},
1:{app:"abc",appId:"1234"appfunctions:[2:{name:"tr",class:"123",Ismenu:"Y"}]},
2:{app:"test",appId:"123"appfunctions:[0:{name:"ter",class:"12",Ismenu:"Y"}]}
]

Answers (1)