DoublyLinkedList.prototype.shift = function () {
    if (this.length === 0) return null;

    const node = this.front.next;
    _remove(node);