[Solved] How can I change the if else statement in the function with Ternary operator in JavaScript?
The code is very inefficient because you find the thing, and then you turn around and find the thing again. So you end up looping multiple times. To make it more readable, I broke it up into parts. It also loops one time over the object to locate the items with children and the items … Read more