Tell us what’s happening:
help me out with this challenge. Thanks in advance.
Your code so far
function largestOfFour(arr) {
// You can do this!
var max = 0,i,j,res = [];
for (i = 0; i < arr.length; i++) {
for(j = 0; j < arr[i].length; j++) {
if (arr[i][j] > max)
{
max = arr[i][j];
}
}
return res[i] = max;
}
return res;
}
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 (X11; Ubuntu; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0
.
Link to the challenge: