I have a recursive function which does a sort of tree process where each call may call itself multiple times, I don't have any way of knowing how deep or wide it is. How do I run a callback once the entire process has been completed?
I'm thinking of having some sort of object to pass about to do a count but not quite cracked it yet, i'm wondering if there is a known best/better way of doing this.