Tell us what’s happening:
Describe your issue in detail here.
So I’m almost there. But there is a mistake that I made in this excerice. But I don’t see it. I have seen the solution. But I don’t get it why I should do it like this. Can someone help me?
**Your code so far**
function largestOfFour(arr) {
let max = 0;
let newarr = [];
for(let i=0; i < arr.length; i++){
for(let j=0; j < arr[i].length; j++){
if(arr[i][j] > max){
max = arr[i][j];
}
}
newarr[i] = max;
}
console.log(newarr);
return newarr;
}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.60 Safari/537.36
Challenge: Return Largest Numbers in Arrays
Link to the challenge: