Walks a tree, running the predicate function for each node. If the predicate function returns something other than undefined, then the walk will be stopped and the function will return the returned value.
Returned node type, defaults to void.
Subtree root node.
Function that will be run for each node of the tree.
Mode to walk the tree, as defined in WalkTreeMode.
WalkTreeMode
The value returned by the predicate function that stopped the walk, or undefined if the walk was completed.
Walks a tree, running the predicate function for each node. If the predicate function returns something other than undefined, then the walk will be stopped and the function will return the returned value.