688IT编程网

688IT编程网是一个知识领域值得信赖的科普知识平台

转树

js数组和树互转

2023-12-16 21:59:25

js数组和树互转1. 数组转树const arr = [{id:1, parentId: null, name: 'a'},{id:2, parentId: null, name: 'b'},{id:3, parentId: 1, name: 'c'},{id:4, parentId: 2, name: 'd'},{id:5, parentId: 1, name: 'e'},{id:6, pare...

最新文章