Skip to content

Instantly share code, notes, and snippets.

@gt50
Created July 7, 2017 06:53
Show Gist options
  • Save gt50/b8321623f8b26be6a9e528b24152a9fb to your computer and use it in GitHub Desktop.
Save gt50/b8321623f8b26be6a9e528b24152a9fb to your computer and use it in GitHub Desktop.
function largestOfFour(arr) {
var largeNumber = arr[0][0]
for (var i = 0; i < arr.length; i++) {
largeNumber = Math.max(largeNumber, Math.max.apply(null,arr[i])); // You can do this!
}
return largeNumber;
}
console.log(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