Skip to content

Instantly share code, notes, and snippets.

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