mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-11-14 06:52:59 +08:00
Compare commits
2 Commits
5a7147b83b
...
1f2fb041d7
Author | SHA1 | Date | |
---|---|---|---|
|
1f2fb041d7 | ||
|
16d6ffc697 |
@ -1,8 +1,9 @@
|
|||||||
export default class DoublyLinkedListNode {
|
export default class DoublyLinkedListNode {
|
||||||
constructor(value, next = null, previous = null) {
|
constructor(value, next = null, previous = null) {//create a constructor.
|
||||||
this.value = value;
|
|
||||||
this.next = next;
|
this.value = value;//the this keyword is used to refer to the object being created pretty much like a memory locatin
|
||||||
this.previous = previous;
|
this.next = next;//this is to store the address of the next node
|
||||||
|
this.previous = previous;//this is to store the address of the previous node
|
||||||
}
|
}
|
||||||
|
|
||||||
toString(callback) {
|
toString(callback) {
|
||||||
|
Loading…
Reference in New Issue
Block a user