Created
February 24, 2017 20:56
-
-
Save Kolenov/62493215a76d213cfb133024c9a7fdcf to your computer and use it in GitHub Desktop.
Get the max or the min in an array of numbers
This file contains 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