Tell us what’s happening:
Describe your issue in detail here.
Hello,
I have been having difficulty detecting my mistake in this code. I would appreciate any hint.
**Your code so far**
function largestOfFour(arr) {
let newArr = [];
for(let i = 0; i < arr.length; ++i) {
for(let a = 0; a < arr[i].length; ++a) {
newArr[i] = arr[i][0];
if(arr[i][a] > newArr[i]) newArr[i] = arr[i][a];
}
}
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/96.0.4664.110 Safari/537.36
Challenge: Return Largest Numbers in Arrays
Link to the challenge: