Created
February 27, 2009 21:37
-
-
Save iros/71718 to your computer and use it in GitHub Desktop.
Extend the javascript Array object to include max/min routines using the apply method
This file contains hidden or 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