removeNodes = (container, startNode, endNode = null) => {
    let node = startNode;
    while (node !== endNode) {
        const n = node.nextSibling;
        container.removeChild(node);
        node = n;
    }
}
Removes nodes, starting from `startNode` (inclusive) to `endNode`
(exclusive), from `container`.