DEV Community

Discussion on: Typescript Data Structures: Linked List

Collapse
 
nsholmes profile image
NsHolmes

Hi Gleb,
Thanks for the article. I like the recursive function in the insertAtEnd. Shouldn't the recursive call to getLast(node) be getLast(node.next)? So that the next node will be checked?

Collapse
 
glebirovich profile image
Gleb Irovich

Hey! You are totally right, nice catch. I will update the code!