LinkedList.prototype.reverse = function () { var tail = function(prev, current){ if (current.next) { tail(current, current.next); } else { this.head = current; } current.next = prev; }.bind(this); tail(null, this.head); };