+ 5
Why don't this code remove the last paragraph element from div? [SOLVED]
5 Réponses
+ 4
I think I got it ,when first element is removed ,f length gets reduced to 1 from 2 and since the next element to be removed is at index 1 the only element left in f array is at index 0
+ 2
Abhay
If you haven't already, replace the children with these
<p>0</p>
<p>1</p>
<p>2</p>
<p>3</p>
<p>4</p>
<p>5</p>
+ 2
So it removes the element at even indexes ,how is that even possible? Isn't for loop used to iterate through every element in array
+ 2
A little visual
https://code.sololearn.com/Wg5TJKC4k4NV/#html
+ 2
ODLNT nice one,ty:-)