Skip to content

Array to Tree

Enter the data and parameters that meet the rules to see the effect of array to tree conversion

数据:
参数:
输出:
[
  {
    "id": "1",
    "pid": "",
    "children": [
      {
        "id": "2",
        "pid": "1",
        "children": [
          {
            "id": "4",
            "pid": "2",
            "children": []
          }
        ]
      },
      {
        "id": "3",
        "pid": "1",
        "children": []
      }
    ]
  }
]

Released under the MIT License.