var numbers = [1,2,0,3,0,4,0,5];
If I have the above array and I want to remove the 0s and output an array of [1,2,3,4,5] how would I do it?
I have the below code but I am getting an "TypeError: arr.includes is not a function" error...
var zero = 0;
var x = balDiffs.map(function(arr, i) {
console.log(arr);
if(arr.includes(zero)) {
return i;
}
});
Array.filter?