re: JavaScript Data Structures: Singly Linked List: Shift VIEW POST


Thanks for your work, just one thing I see which I find unnecessary is the else block after even though you are already returning above.

 //  instead of this
 if (!this.length) {
      return null;
    } else { 
   // do something

// we can simply write 
if (!this.length) return null;
// do something
code of conduct - report abuse