forEach does not access all elements in NodeList
forEach does not access all elements in NodeList Since the forEach array method can now be called on a NodeList . I was wondering why if you make changes to the content of a childNodes NodeList while looping with forEach , forEach does not detect the changes. forEach NodeList childNodes forEach forEach grid.childNodes.forEach(function(tableRow, index, nodeList) { tableRow.remove(); }); Here, i'm trying to loop through my table(grid) elements children and remove each children( tableRow ) from the table. However, forEach never completely loop over every element, always leaving out one last tableRow to be remove d.I think it has something to do with the childNodes NodeList being live, and the forEach not being able to properly follow it or something. tableRow forEach tableRow remove What’s your relevant html? What’s the selector for grid ? – David Thomas 6 mins ago ...