Single Linked List Insertion Algorithm In Array In Js