Hi all, I’ve just finished this challenge and my code passed fine (yay!).
I’ve done some Googling since to see how others solved this problem and haven’t found anything that resembles my solution and would appreciate any critiques or suggestions as I’m not sure if my answer is ‘good’ or if I’ve just fluked something that happens to pass!
function largestOfFour(arr) {
arr.map(function (val){
val.sort(function (a, b){
return a - b;
});
});
arr = arr.map(function (val){
return val.pop();
});
return arr;
}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
