Skip to content

LinkedList

Class | Source Code

implements ILinkedList

Implementation of a doubly linked list.

The first value in the linked list, or undefined if the list is empty.


The first node in the linked list, undefined if the list is empty.


Whether the linked list is empty.


The last value in the linked list, or undefined if the list is empty.


The number of elements in the linked list.


The linked list with the head removed. The head of the linked list retrieved this way is equivalent to head.next.


The last node in the linked list, undefined if the list is empty.

Adds the specified value to the end of the linked list.


Clears the list, emptying it entirely.


Filters the linked list based on the prvoided predicate.

A new linked list with the elements that passed the test of the provided predicate.


Finds the element that passes the provided predicate.

The element that passed the provided predicate, undefined if no element passed.


Iterates over every element in the linked list.


Searches the linked list for the specified value.

Whether the specified value exists in the linked list.


Generates a new linked list by iterating over each element and invoking the provided iteratee. The type of the generated linked list depends on the type of the value returned by the iteratee.

A new linked list comprised of all values collectively returned from individual invocations of the provided iteratee.


Adds the specified value to the front of the linked list.


Removes the specified value from the linked list.


Removes the first element that passes the test of the passed predicate.


Removes the first value from the linked list.


Removes the final value from the linked list.


Goes through the elements in the linked list and tests them with the provided predicate.

Whether any element in the array passed the test specified by the provided predicate.


The linked list as an array.


The linked list as a human-readable string.