DoublyLinkedList.prototype.addToHead = function(element) {
var newNode = new Node(element);
if (this.head) {
this.head.previous = newNode;
newNode.next = this.head;
} else {
this.tail = newNode;
}
this.head = newNode;
this._length++;
};
Also see: Tab Triggers