Tell us what’s happening:
Your code so far
function largestOfFour(arr) {
// You can do this!
var max;
var newArray = [];
for(var i = 0; i < 4; i++){
max = 0;
for(var j = 0; j < 4; j++){
if(arr[i][j] > max)
max = arr[i][j];
}
newArray[i] = max;
}
console.log(newArray);
return arr;
}
largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [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/73.0.3683.103 Safari/537.36
.
Link to the challenge:
What am I doing wrong ? I see correct results but it still says it’s wrong.