I'm trying to understand the error DOMException: Node.insertBefore: Child to insert before is not a child of this node which I've seen in both React and Angular projects over time and I started wondering: why does it even matter if an element A is "a child of" element B? Why choosing Node.insertBefore() over Element.insertAdjacentElement()?
The way I see it, both have browser support for ages and both work for SVG. But Node.insertBefore() seems to have an awkward API to me, because it requires to specify the parent.
Am I missing something?