function(vertex) {
      if (this.head === null) {
        this.head = vertex;
      } else {
        this.tail.next = vertex;
      }

      vertex.prev = this.tail;
      vertex.next = null; // the tail has no subsequent vertex

      this.tail = vertex;

      return this;
    }
function(vertex) {
      if (this.head === null) {
        this.head = vertex;
      } else {
        this.tail.next = vertex;
      }

      vertex.prev = this.tail;
      vertex.next = null; 

      this.tail = vertex;

      return this;
    }
function ( vertex ) { if ( this . head === null ) { this . head = vertex ; } else { this . tail . next = vertex ; } vertex . prev = this . tail ; vertex . next = null ; // the tail has no subsequent vertex this . tail = vertex ; return this ; }
Appends a vertex to the end of the linked list
Appends a vertex to the end of the linked list