Greetings. I just finished the challenge Use Depth First Search in a Binary Search Tree.

This post contains a spoiler since it has the answer.

So this is the FCC answer to the inorder search and it’s waaay simpler than what I did:

```
this.inorder = function() {
if (this.root === null) return null;
const nodes = [];
function traverse(root) {
if (root === null) return;
traverse(root.left); // Left
nodes.push(root.value); // Root (in-order)
traverse(root.right); // Right
}
traverse(this.root);
return nodes;
}
```

Would someone please explain to me how it ever gets past the leftmost item in the tree? From what I understand, return simply ends the function (where it says `if (root === null) return;`

).

How does traverse run again at that point if it isn’t called again? And how does it ever get to the right side, and how does it avoid pushing duplicate values onto the nodes array over and over?

Thank you for your help. There’s always so much to learn.