[SOLVED] Best way to destroy all children of an entity?

I am using this method:

let child;
for (let i = 0; this.container.children.length > 0; i++) {
    child = this.container.children.pop();

Is it possible to do so?
Will there be an eternal cycle?

I would probably use a while loop instead:

while(this.container.children.length > 0) {
1 Like