linked list implemented using js