Tell us what’s happening:
I tried for multiple times and in multiple ways, but I still cannot get to the end of it. Someone give me some advice from their perspective.
Your code so far
function largestOfFour(arr) {
// You can do this!
var arrMod = arr;
var arrNew = [];
for(i=0; i<arrMod.length; i++) {
for (j=0; j<arrMod[i].length; j++) {
arrMod[i].sort();
} arrNew.push(arrMod[i][3]);
}
return arrNew;
}
largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/return-largest-numbers-in-arrays