Tell us what’s happening:
Your code so far
function filteredArray(arr, elem) {
let newArr = [];
// change code below this line
for(let i = 0; i < arr.length;i++){
arr[i].forEach(function(item){
if(item == elem){
arr.splice(i,1);
}
})
}
newArr = [...arr];
// change code above this line
return newArr;
}
// change code here to test different cases:
console.log(filteredArray([[3, 2, 3], [1, 6, 3], [3, 13, 26], [19, 3, 9]], 3));