data-structure-algebra/doubly-linked-list

View on GitHub
src/Node.js

Summary

Maintainability
A
0 mins
Test Coverage
/**
 * Base node class.
 *
 * @class
 * @param {any} value The value to hold.
 * @param {Node|null} prev The value to hold.
 * @param {Node|null} next The value to hold.
 */

export default function Node(value, prev, next) {
    /** @member {any} The value/key held by this node. */
    this.value = value;
    /** @member {Node|null} Pointer to previous (left) sibling */
    this.prev = prev;
    /** @member {Node|null} Pointer to next (right) sibling */
    this.next = next;
}