This is a complete implementation of a Singly Linked List in JavaScript using ES6 class syntax. It's built entirely from scratch without using built-in array methods, and includes all core linked list operations as well as some extra credit features.
- β Append elements to the end
- β Prepend elements to the start
- β Get the size of the list
- β
Get the first (
head) and last (tail) node - β
Access a node by index with
at(index) - β
Remove the last node using
pop() - β
Check if a value exists in the list using
contains(value) - β
Find the index of a value using
find(value) - β
Represent the list as a string with
toString() - β
(Extra) Insert a node at a specific index with
insertAt(value, index) - β
(Extra) Remove a node at a specific index with
removeAt(index)