Created
March 16, 2017 22:33
-
-
Save lachlan-eagling/9223ce97964af35376327a9370e9db04 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) { | |
var temp = []; | |
for(var i = 0; i < arr.length; i++){ | |
var elem = arr[i]; | |
elem.sort(function(a, b){ | |
return a < b; | |
}); | |
temp.push(elem[0]); | |
} | |
arr = temp; | |
return arr; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment