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