Skip to content

Instantly share code, notes, and snippets.

@stephanschubert
Created March 28, 2011 15:54
Show Gist options
  • Save stephanschubert/890713 to your computer and use it in GitHub Desktop.
Save stephanschubert/890713 to your computer and use it in GitHub Desktop.
Simple but elegant solution for creating Array#min/max in JavaScript
Array.max = function(array){
return Math.max.apply(Math, array);
};
Array.min = function(array){
return Math.min.apply(Math, array);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment