In my code, I fairly frequently need to replace all children of a certain HTML container with a new list of children.
What is the fastest way to do this? My current appr
It is not directly solving the question but in most cases it is usable and probably one of the more performant ways.
You can swap out the whole node instead of deleting and filling its content.
oldNode.parentElement.replaceChild(newNode, oldNode)