javascript
javascript remove element from array in foreach
Removing elements from an array during a forEach() loop can be a tricky process. This is because forEach() loops through the array in order and thus when you remove an element from the array, you are essentially changing the size of the array and thus the index of the elements