I get a Javascript Object from my server, which depicts a filesystem. Now I want to get the path of all files in the system, e.g. the endpoints of the tree.
File str
I was busy having a play with your original question and got this working:
goToDeepestPoint(json);
function goToDeepestPoint(node) {
if (node.is_dir)
node.children.forEach(function (child) {
goToDeepestPoint(child);
});
else
return out(node.path);
}
May not be appropriate in the light of your edit, but shame to waste it!