I need to create a custom tree data-structure using JavaScript

前端 未结 4 1801
悲&欢浪女
悲&欢浪女 2021-02-10 18:14

I looked up this basic format for a tree structure in javascript:

function Tree(parent, child, data) {
    this.parent = parent;
    this.children = child || [];         


        
4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-10 18:35

    Have a look at this approach on how to create tree structures from SQL queries:

    http://blog.tcs.de/creating-trees-from-sql-queries-in-javascript/

提交回复
热议问题