Linked List implementations in Javascript