diff --git a/chapter05/03-DoublyLinkedList2.js b/chapter05/03-DoublyLinkedList2.js index 9fe7d87b..896c256e 100644 --- a/chapter05/03-DoublyLinkedList2.js +++ b/chapter05/03-DoublyLinkedList2.js @@ -23,7 +23,7 @@ let DoublyLinkedList2 = (function () { append(element) { let node = new Node(element), - current, _tail; + _tail; if (this.getHead() === null) { //first node on list head.set(this, node); @@ -54,7 +54,7 @@ let DoublyLinkedList2 = (function () { if (position === 0) { //add on first position - if (!this.getHead()) { //NEW + if (!current) { //NEW head.set(this, node); tail.set(this, node); } else { diff --git a/chapter06/01-Set2.js b/chapter06/01-Set2.js index 10e11b45..c177648e 100644 --- a/chapter06/01-Set2.js +++ b/chapter06/01-Set2.js @@ -55,7 +55,7 @@ let Set2 = (function () { } union(otherSet){ - let unionSet = new Set(); + let unionSet = new Set2(); let values = this.values(); for (let i=0; i