added cyclic method to linked list prototype in js