Skip to content

Instantly share code, notes, and snippets.

@famasya
Created October 31, 2015 13:43
Show Gist options
  • Save famasya/3c2c8e675e09b517b1b3 to your computer and use it in GitHub Desktop.
Save famasya/3c2c8e675e09b517b1b3 to your computer and use it in GitHub Desktop.
function largestOfFour(arr) {
arr = arr.map(function(val){
return val.sort(function(a,b){
return b-a;
})[0];
});
return arr;
}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment