My code:
let newArr = [[1,5,6,4],[8,5,4],[4,4,4,4]];
function filterArr(arr, elemn){
for(let i = 0; i < arr.length; i++){
for(let j=0; j < arr[i].length; j++){
if(arr[i][j] === elemn){
arr[i].splice(j,1);
}
}
}
return arr;
}
console.log(filterArr(newArr,4));
The Result: [[1,5,6],[8,5],[4,4]]
I am stuck at this point : [4,4] it supposed []
any suggestion plz ...