I have this Javascript:
factory.remove = function (arr, property, num) {
for (var i = arr.length - 1; i >= 0; --i) {
if (arr[i][property] === num)
arr.splice(i, 1);
}
};
Can someone tell me how I could change the for loop to use a .forEach instead? What I am not sure about is how in the forEach I can access the i ? Also if I use the forEach will I be able to do a splice of that array or is it not possible?
foreachoverforhere?