I have an object structure like so;
{
this.parent = undefined;
this.children = [];
}
All values in children have the same structure as above except that their parent would be would a reference to the object that has it as its child.
How can I easily iterate over all children of children etc but in the child's object context?
I know how I can loop the children for one object
obj.children.forEach(function(child) {
});
But how can I iterate all children of children, when the children could be into 10-20-30 deep heirachy?
recursivefunction.