A number of these are using older, awkward APIs, when there's nicer native versions now.
For example, "replace an element" is
ele.parentNode.replaceChild(newEle, ele);
but unless you're targeting Chrome < 54, FF < 49, or Safari < 10, you can just do ele.replaceWith(newEle)
`replaceWith` also lets you replace a node with _multiple_ nodes, or with text.Similarly, "loop over a nodelist" wants you to use array spread and then forEach, instead of just
for (let ele of nodelist) ...