diff --git a/JavaScript/6-doubly-proto.js b/JavaScript/6-doubly-proto.js index 62e5a21..d2324aa 100644 --- a/JavaScript/6-doubly-proto.js +++ b/JavaScript/6-doubly-proto.js @@ -20,6 +20,7 @@ LinkedList.prototype.pop = function() { if (this.length === 0) return null; const node = this.last; this.last = node.prev; + this.last.next = null; node.list = null; node.prev = null; node.next = null;