O
O
olya_0972018-05-16 14:26:30
JavaScript
olya_097, 2018-05-16 14:26:30

Can you please explain the createTreeText(obj) function?

Can you please explain the createTreeText(obj) function?
plnkr.co/edit/IFlp4cF5NpgsaXYvSyQf?p=preview

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton, 2018-05-16
@Eridani

You have an object with nesting, you need to display it while maintaining this nesting through lists ul li
Recursive function for building a tree \ nesting
The createTree function takes two parameters - in which selector to push the results of the createTreeText function and, in fact, the object itself with the data that we are going to process.
createTreeText directly builds a tree \ nesting, goes through the items, and if the item has a parent, then it puts a child item in the parent

I
Ivan, 2018-05-16
@asmodeusta

Read about recursion first

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question