Created
January 4, 2014 18:24
-
-
Save jswhisperer/8258620 to your computer and use it in GitHub Desktop.
Get the max or the min in an array of numbers
This file contains hidden or 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
var numbers = [5, 458 , 120 , -215 , 228 , 400 , 122205, -85411]; | |
var maxInNumbers = Math.max.apply(Math, numbers); | |
var minInNumbers = Math.min.apply(Math, numbers); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment