Closed tomastrajan closed 6 years ago
Thanks @tomastrajan for this! Do you happen to have a code example for this? or even pseudo code
Not really but it's about recursively traversing children until the desired element is found.
okay cool 👍 I will research that soon
I don't mind giving this a try. @jadjoubran how many lines of code do you recommend this to be?
Thanks @OdinTech3! Most use cases on CodeToGo are at most 2 to 3 lines of readable javascript code If it turns out to be a complicated method then it's probably better suited for 30-seconds-of-code than codetogo
Traversing tree data structure, eg objects with children property recursively to arbitrary depth is useful for interviews and also in practice when implementing with stuff like file explorer or multi level nested menus.