var roots = [], children = {};
// find the top level nodes and hash the children based on parents
for (var i = 0, len = arry.length; i < len; ++i) {
var item = arry[i],
p = item.Parent,
target = !p ? roots : (children[p] || (children[p] = []));
// I am not able to understand this line what it does
// target = !p ? roots : (children[p] || (children[p] = []));
target.push({ value: item });
}
what I understand that if p is null then childrens for that parent should be empty but why then need to use of || expression that is used in this code
(children[p] || (children[p] = [])