my code for some reasons isn’t working . can someone help please ??
function filteredArray(arr, elem) {
let newArr = [];
// Only change code below this line
newArr = [...arr];
for(let i = 0; i < arr.length ; i++){
for(let j = 0; j < arr[i].length; j++){
if(arr[i][j] === elem){
newArr.splice(i, 1);
}
}
}
// Only change code above this line
return newArr;
}
console.log(filteredArray([[3, 2, 3], [1, 6, 3], [3, 13, 26], [19, 3, 9]], 3));