Skip to content

Instantly share code, notes, and snippets.

@samgreen
Created April 22, 2014 00:11
Show Gist options
  • Save samgreen/11160891 to your computer and use it in GitHub Desktop.
Save samgreen/11160891 to your computer and use it in GitHub Desktop.
function maxInArray(numbers) {
var max = -1;
for (var i = 0; i < numbers.length; i++) {
if (numbers[i] > max) {
max = numbers[i];
}
}
return max
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment