list-to-tree
list-to-tree copied to clipboard
root node parent can be undefined
var list = [
{
id: 1,
// parent: 0 // this is not necessary any more
}, {
id: 2,
parent: 1
}]
// ...