CreateTreeText function(obj) explain, please?

CreateTreeText function(obj) explain, please?
June 5th 19 at 21:38
2 answers
June 5th 19 at 21:40
You have an object with nested, you need to display it with the preservation of nesting through lists ul li
Recursive function building a tree \ nesting
Function createtree method takes two parameters, in which the selector stuff results function createTreeText and , actually, the object with the data that we are going to handle.

createTreeText directly builds a tree of \ nesting, loops through the items and if the item has no parent, it puts in the parent's child item
if (li) {
 var ul = '<ul>' + li + '</ul>'
 return ul || ";

But it's there for what? - deangelo_Pacocha commented on June 5th 19 at 21:43
June 5th 19 at 21:42
First read about recursion

Find more questions by tags JavaScriptRecursion