Iterate and delete element from array
The splice() method changes the contents of an array by removing existing elements and/or adding new elements.
let i = arr.length;
while (i--) {
if (arr[i] == something) {
arr.splice(i, 1);
}
}
Looping through array and removing items, without breaking for loop