Skip to content

Commit 70eefa4

Browse files
author
echosteg
committed
removed unused variable in Doubly linked list and amended insert method
1 parent d287512 commit 70eefa4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

chapter05/03-DoublyLinkedList2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ let DoublyLinkedList2 = (function () {
2323
append(element) {
2424

2525
let node = new Node(element),
26-
current, _tail;
26+
_tail;
2727

2828
if (this.getHead() === null) { //first node on list
2929
head.set(this, node);
@@ -54,7 +54,7 @@ let DoublyLinkedList2 = (function () {
5454

5555
if (position === 0) { //add on first position
5656

57-
if (!this.getHead()) { //NEW
57+
if (!current) { //NEW
5858
head.set(this, node);
5959
tail.set(this, node);
6060
} else {

0 commit comments

Comments
 (0)