How many levels are in a Javascript array?
The user has children, children also have children as in the code example. There are a maximum of 5 such levels, but maybe less, 2, 3. My task is to iterate each level and return the number of children the…