Skip to content

Instantly share code, notes, and snippets.

@cdmz
Created January 26, 2016 01:39
Show Gist options
  • Save cdmz/6c63cb980bdddf290ff7 to your computer and use it in GitHub Desktop.
Save cdmz/6c63cb980bdddf290ff7 to your computer and use it in GitHub Desktop.
get max and min value in array javascript
var numbers = [-215, 458 ,5, , 120 , 584 , 228 , 400 , 122205, -85411];
var max = Math.max.apply(Math, numbers);
var min = Math.min.apply(Math, numbers);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment