Skip to content

Commit aea3084

Browse files
committed
small fixes applied to code - chap 5
1 parent 66b57b4 commit aea3084

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

chapter05/01-Linked-List.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -149,18 +149,18 @@ function LinkedList() {
149149

150150
this.toString = function(){
151151

152-
var current = head,
152+
var current = head,
153153
s = current.element;
154154

155155
while(current.next){
156156
current = current.next;
157157
s += ', ' + current.element;
158158
}
159159

160-
return s;
160+
return s.toString();
161161
};
162162

163163
this.print = function(){
164164
console.log(this.toString());
165-
}
165+
};
166166
}

0 commit comments

Comments
 (0)