I have an array of objects. Every object in the array has an id and an item property that is an array containing other object. I need to be able to find an element in an arr
yeah thanks but I have an issue if there is a nested array like you wanna build a menu panel yourself and wanna get an item with a specific id no matter where is it
example :
var treeDataSource = [ { Id: 1, Name: "s", Children: [ { Id: 2, Name: "m", Children: [ { Id: 3, Name: "q", Children: [ { Id: 4, Name: "a", Children: [ { Id: 5, Name: "w", Children: [ { Id: 6, Name: "needed", Children: [], } ], } ], } ], } ], } ], }, ]
I wanna return the item matches Id 6