轻语

Results 2 comments of 轻语

[...new Set(arr.toString().split(',').map(k => +k))].sort((a, b) => a-b)

```js const listToTree = (tree) => { const map = tree.reduce((map, crt) => (map[crt.id] = crt, crt.children = [], map), {}) return tree.filter(node => { node.parentId && map[node.parentId].children.push(node) return !node.parentId...