Skip to content

Commit 9e07a94

Browse files
authored
Merge pull request knaxus#52 from Mk996/master
return list instead of console.log
2 parents fc1f466 + dbfe9f1 commit 9e07a94

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)