This is an unsafe loop, you are looping forward but modifying the array. `.length` will be different each time and this will leak children.