Skip to content

Instantly share code, notes, and snippets.

@chapel
Created January 30, 2013 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chapel/4673848 to your computer and use it in GitHub Desktop.
Save chapel/4673848 to your computer and use it in GitHub Desktop.
var arr = [1, 2, 3, 4, 5, 6, 7, 8]
, highest
for (var i = 0; i < arr.length; i+=1) {
if (i === 0) highest = arr[i]
if (highest < arr[i]) highest = arr[i]
}
console.log(highest)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment