D3.js node.links() Function
The node.links() function returns an array of links to the children of the node object, each link object has a source and a target field that hold references to child nodes.
Parameters: This method does not accept any parameters.
Return Values: This method returns an array of links to the children of the node object.
Example 2: Root containing no children return empty links array.