Skip to content

Commit dbfe9f1

Browse files
committed
return list instead of console.log
1 parent 1cd6613 commit dbfe9f1

File tree

1 file changed

+3
-1
lines changed
  • src/_DataStructures_/DoublyLinkedList

1 file changed

+3
-1
lines changed

src/_DataStructures_/DoublyLinkedList/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@ class DoublyLinkedList {
5555

5656
display() {
5757
let address = this.head.next;
58+
let addresses = []
5859
while (address !== this.tail) {
59-
console.log(address.data);
60+
addresses.push(address.data)
6061
address = address.next;
6162
}
63+
return addresses
6264
}
6365
}
6466

0 commit comments

Comments
 (0)