An implementation of a linked list class in JavaScript