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
remove
removeChild
while (container.firstChild) { container.firstChild.remove(); }
Alternatively:
let child; while (child = container.firstChild) { child.remove(); }