DEV Community

Discussion on: Creating Linked Lists With JavaScript

Collapse
 
dallgoot profile image
dallgoot

Very educational good job.
you can also get a shortcut for gettting the last Node

if (index === this.length-1 )  {
  return this.tail;
}

That is if i'm not mistaken and the length property can be trusted