Singly Linked List implemented with JavaScript
append(value)adds a new node withvalueto the end of the list.prepend(value)adds a new node withvalueto the start of the list.size()returns the total number of nodes in the list.head()returns the value of the first node in the list.tail()returns the value of last node in the list.at(index)returns the value of the node atindex. Raises aRangeErrorifindexis bigger thansize.pop()removes the last node from the list.contains(value)returnstrueifvalueis in the list.find(value)returns the index of the node containingvalue, ornullif not found.toString()returns string represenation of the list in the following format: ( value ) -> ( value ) -> ( value ) -> null.insertAt(value, index)inserts a new node withvalueatindex. Raises aRangeErrorifindexis bigger thansize.removeAt(index)removes the node atindex. Raises aRangeErrorifindexis bigger thansize.clone()returns a deep copy of the list.