Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. function insert(head, data) {
  2. var newNode = new Node(data);
  3. var last = head;
  4. if(last === null) head = newNode;
  5. else {
  6. while(last.next !== null){
  7. last = last.next;
  8. }
  9. last.next = newNode;
  10. }
  11. return head;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement