Tell us what’s happening:
Describe your issue in detail here.
**Your code so far**
function filteredArray(arr, elem) {
let newArr = [];
// Only change code below this line
for (let i = 0; i < arr.length; i++) {
if (!arrayHasElem(arr[i],elem)) {
newArr.push(arr[i]);
}
}
// Only change code above this line
return newArr;
}
function arrayHasElem(arr,elem){
for (let i = 0; i < arr.length; i++) {
if (arr[i] === elem) {
return true;
}
}
return false;
}
console.log(filteredArray([[3, 2, 3], [1, 6, 3], [3, 13, 26], [19, 3, 9]], 3));
Challenge: Iterate Through All an Array’s Items Using For Loops
Link to the challenge: