Returns true if the list is empty.
Returns the current head.
Returns the current tail.
Creates an iterable iterator, starting at the specified node, getting the next node from the next() function.
Note that using iterators is not as performant as some or forEach
The starting node. (inclusive)
The ending node (exclusive).
A method that is given the current node, and returns the next node.
Returns the first node matching the given predicate.
Returns the last node matching the given predicate.
Inserts the given node after pointer node.
The node to insert after pointer. If this node is currently in this list, it will first be removed.
The pointer node.
Inserts the given node before pointer node.
The node to insert before pointer. If this node is currently in this list, it will first be removed.
The pointer node.
Removes the last node (the tail), returning it. If this list is empty, null is returned.
Creates a new node for the given value, adding it to the end of the list.
Returns the newly created node.
Appends all given values to the end of this list.
Rest...values: T[]Appends the given node to the tail of this list. If the node is already at the tail, it will no-op. If the node is in this list, it will be removed.
The node to add or move to the tail of this list.
Removes the given linked node.
Removes the first node (the head), returning it.
Creates a new node, adding it to the front of the list.
The value to box in a linked node.
Returns the new node.
Prepends all the given values to the head of this list. The values will maintain their order.
E.g.
list.unshiftAll(8, 9, 10) // 8, 9, 10
list.unshiftAll(4, 5, 6, 7) // 4, 5, 6, 7, 8, 9, 10
list.unshiftAll(1, 2, 3) // 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Rest...values: T[]The values to box in linked nodes.
Prepends the given node to the head of this list.
The node to add or move to the head of this list.
A standard doubly-linked list implementation.