While going through some code in d3.js to create a tree I found the symbol '_' being used and I have no what it is doing and have had no concrete solutions. The question I was looking at is this How to highlight path from root to selected node in d3 js?
The full code of the program I was referencing is this http://plnkr.co/edit/SKVV4A7a9bV0bZupS9M2?p=preview
I cant understand how the flatten function works especially why _ is used
function flatten(root) {
var nodes = [],
i = 0;
function recurse(node) {
if (node.children) node.children.forEach(recurse);
if (node._children) node._children.forEach(recurse);
if (!node.id) node.id = ++i;
nodes.push(node);
}
recurse(root);
return nodes;
}
Any help is appreciated thank you.