you can do like this fiddle,
function getChildren(id){
let result = [];
$.each(orig, function(i, d) {
if (d.parent === id) {
result.push(d);
result.push(...getChildren(d.id));
}
});
return result;
}
console.log(getChildren('Test'));
1
solved Recursively Search Through a Flat Array