JSFiddle - React, Tailwind, and code Playground
JavaScript
function largestOfFour(largestOfFour) {
largestOfFour.forEach(function(number, index){
number.sort(function(a, b){
return b - a;
});
largestOfFour[index] = number[0];
});
alert(largestOfFour);
};
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);