DEV Community

ZeeshanAli-0704
ZeeshanAli-0704

Posted on

Print the Elements of a Linked List

function printLinkedList(head) {
let current = head;
while(current){
    console.log(current.data);
    current = current.next;
 }
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)