2

Here are my thoughts:
Don't mutate function parameters unless there is good reason to do so.
node.depth = level;
The above statement basically breaks the contract of the function. The function claims to locate the deepestNode, but in fact it does findDeepestNodeAndSetDeepestPropOnAllNodes (s...