@@ -23,9 +23,9 @@ export default class DoublyLinkedList {
2323// Make new node to be a head.
2424const newNode = new DoublyLinkedListNode ( value , this . head ) ;
2525
26- // If there is head, then it won't be head anymore
27- // Therefore, make its previous reference to be new node (new head)
28- // Then mark the new node as head
26+ // If there is head, then it won't be head anymore.
27+ // Therefore, make its previous reference to be new node (new head).
28+ // Then mark the new node as head.
2929if ( this . head ) {
3030this . head . previous = newNode ;
3131}
@@ -57,7 +57,7 @@ export default class DoublyLinkedList {
5757// Attach new node to the end of linked list.
5858this . tail . next = newNode ;
5959
60- // Attach current tail to the new node's previous reference
60+ // Attach current tail to the new node's previous reference.
6161newNode . previous = this . tail ;
6262
6363// Set new node to be the tail of linked list.
@@ -83,10 +83,10 @@ export default class DoublyLinkedList {
8383deletedNode = currentNode ;
8484
8585if ( deletedNode === this . head ) {
86- //set head to second node, which will become new head
86+ //Set head to second node, which will become new head.
8787this . head = deletedNode . next ;
8888
89- //set new head's previous to null
89+ //Set new head's previous to null
9090if ( this . head ) {
9191this . head . previous = null ;
9292}