My Problem
I was trying to output the array which dont have the number from the elem arguments. I think there is no problem with my code even the challenges is passed, but when i tried to console/write it, it doesn’t showed up. is there anything i have been missing?
function filteredArray(arr, elem) {
let newArr = [];
// change code below this line
for(let i = 0; i < arr.length; i++){
if(arr[i].indexOf(elem) < 0){
newArr.push(arr[i]);
}
}
// 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));
hey, sorry for the problems, you are right there were no problem with my code, it was just me whose missing off with the array that i want to push.
I give the array as shown below:
my code was to push an array which don’t have number 3 inside it, and sadly, i didn’t notice that every of my array has number 3 , sorry for any trouble i cause.