Last active
November 18, 2015 19:57
-
-
Save IAmAnubhavSaini/e6d47fa3979fae5006ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function largestOfFour(arr) { | |
myArr = []; | |
arr.forEach(function(a){ myArr.push(a.sort(function(a, b){ return a-b;}).pop()); }); | |
return myArr; | |
} | |
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
I think I can still make it better.
I think there is a bit of good in this code.