Print the Elements of a Linked List

  • + 0 comments

    solved using recursion

    function printLinkedList(head) {``
       if(head === null) return;
       console.log(head.data)
       printLinkedList(head.next)
    
    }