Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save snowman-repos/8840636 to your computer and use it in GitHub Desktop.
Save snowman-repos/8840636 to your computer and use it in GitHub Desktop.
Get the max or the min in an array of numbers
numbers = [
5
458
120
-215
228
400
122205
-85411
]
maxInNumbers = Math.max.apply(Math, numbers)
minInNumbers = Math.min.apply(Math, numbers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment