Construct a new linked list.
The first value in the list.
This is undefined
if the list is empty.
Constant.
The first node in the list.
This is null
if the list is empty.
Constant.
Whether the list is empty.
Constant.
The last value in the list.
This is undefined
if the list is empty.
Constant.
The last node in the list.
This is null
if the list is empty.
Constant.
The length of the list.
Constant.
Add a value to the beginning of the list.
The value to add to the beginning of the list.
The list node which holds the value.
Constant.
Add a value to the end of the list.
The value to add to the end of the list.
The list node which holds the value.
Constant.
Remove all values from the list.
Linear.
Insert a value after a specific node in the list.
The value to insert after the reference node.
The reference node of interest. If this is null
,
the value will be added to the end of the list.
The list node which holds the value.
The reference node must be owned by the list.
Constant.
Insert a value before a specific node in the list.
The value to insert before the reference node.
The reference node of interest. If this is null
,
the value will be added to the beginning of the list.
The list node which holds the value.
The reference node must be owned by the list.
Constant.
Create an iterator over the values in the list.
A new iterator starting with the first value.
Constant.
Create an iterator over the nodes in the list.
A new iterator starting with the first node.
Constant.
Remove and return the value at the beginning of the list.
The removed value, or undefined
if the list is empty.
Constant.
Remove and return the value at the end of the list.
The removed value, or undefined
if the list is empty.
Constant.
Remove a specific node from the list.
The node to remove from the list.
Constant.
The node must be owned by the list.
Create a reverse iterator over the values in the list.
A new iterator starting with the last value.
Constant.
Create a reverse iterator over the nodes in the list.
A new iterator starting with the last node.
Constant.
Create a linked list from an iterable of values.
The iterable or array-like object of interest.
A new linked list initialized with the given values.
Generated using TypeDoc
A generic doubly-linked list. The namespace for the
LinkedList
class statics.