Tell us what’s happening:
please help me to figure out what is wrong
Your code so far
function largestOfFour(arr) {
// You can do this!
var max;
var newArray = [];
for (var i = 0; i > arr.length; i++){
max = 0;
for (var j = 0; j > arr.[j].length; j++){
if (arr[i][j] > max)
max = arr[i][j];
}
newArray.push(max);
}
return newArray;
}
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/76.0.3809.100 Safari/537.36
.
Link to the challenge: