Here is an example of an array:
var list = [5,10,15,20,25];
This code uses the forEach
function in JavaScript to loop through the array:
list.forEach(function(item){
console.log(item);
});
Now, if you want to remove certain items from the array while looping, for instance let's say you want to remove number 15, how can this be done?