mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2025-12-08 19:06:00 +00:00
12 lines
269 B
JavaScript
12 lines
269 B
JavaScript
export default class DoublyLinkedListNode {
|
|
constructor(value, next = null, previous = null) {
|
|
this.value = value;
|
|
this.next = next;
|
|
this.previous = previous;
|
|
}
|
|
|
|
toString(callback) {
|
|
return callback ? callback(this.value) : `${this.value}`;
|
|
}
|
|
}
|