this seems like dangerous stuff, can we please change it to:

    for (let i = rows.children.length; i >= 0; i--) {
      rows.removeChild(rows.children[i]);
    }