Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review Commented Feb 5, 2022 at 9:24
  • I'd argue that the essential parts are there in text (traverse the tree, terminate recursion and reference object) but sure I can add the whole snippet here. Commented Feb 8, 2022 at 8:00