From 44a9706a1b5296766fc34ffe9adf628ba1e5d135 Mon Sep 17 00:00:00 2001 From: vitpavlenko Date: Thu, 22 Nov 2018 22:07:22 +0200 Subject: [PATCH] overwrite link next --- JavaScript/6-doubly-proto.js | 1 + 1 file changed, 1 insertion(+) 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;