Created
March 28, 2011 15:54
-
-
Save stephanschubert/890713 to your computer and use it in GitHub Desktop.
Simple but elegant solution for creating Array#min/max in JavaScript
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
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