Satellite data of the node.
An array of children of the node.
children
can be an array of nodes or raw values or both. Raw values will be converted to leaves.
Private
#childrenThe children of this tree.
The value of the root of this tree.
Performs a breadth-first search for the given value.
An array of tree nodes with the given value
, appearing in order they were found in the breadth-first search.
The value to compare against.
Whether to do strict (===) or loose (==) comparsion. Defaults to true
(strict).
Performs a depth-first search for the given value.
An array of tree nodes with the given value
, appearing in order they were found in the depth-first search.
The value to compare against.
Whether to do strict (===) or loose (==) comparsion. Defaults to true
(strict).
Removes one or more child nodes. Does not recurse.
The new list of children.
The value or node to remove.
Specify a Tree
when wanting to remove a specific node.
Specify a value of the generic type to remove any first-level children with the given value.
Whether to remove children by value or by strict comparison between Tree objects.
to_remove
must be a Tree if false. When to_remove
is a Tree and this is true
, removes first-level children based on the value of the given node.
Generated using TypeDoc
A tree.